Starting from version 5.0, the Currency Switcher includes a new process to upgrade the data it stores in the database. This article explains how the process works, and how to use the provided interface to review its status.


TABLE OF CONTENTS


1. What's the purpose of the database upgrade process?

The Currency Switcher may run a background task to perform one or more of the following operations:

  1. Upgrading the format or the content of the data it stored.
  2. Collecting data to ensure the accuracy of sales report and analytics.
  3. Migrating data to a newer format.
  4. Housekeeping (e.g. cleanup).


We implemented this feature to be automatic and non-intrusive. In normal circumstances, it doesn't require any intervention from the site administrators. If you would like to review the operations being performed, or need to troubleshoot the process, this article will guide you through the interface.


2. The notification message

When the plugin is configured for the first time, a message like the following is displayed in the backend:

The message window contains a the following key elements:

  1. The ID of the plugin showing the message. In this example, the ID belongs to the Aelia Currency Switcher:
  2. The target database version.
    To ensure a smooth upgrade, the steps required to reach the next version are applied incrementally, in batches. This ensures that the site's performance is not affected by the process.
  3. A button to view the upgrade progress.The button brings to the page showing the actions scheduled by the plugin, allowing the administrator to run them manually. 
  4. A link to this documentation


Please note
The message window always shows the latest upgrade in progress. When the last step has been completed, the window hides itself automatically.


3. How to view the upgrade status

The Currency Switcher relies on the Action Scheduler components included with WooCommerce to schedule its tasks. The Action Scheduler providers an interface where the site administrator can see all the scheduled tasks and view their progress, as well as any error that might have occurred during their execution. 


Below is an example of what the interface looks like:

The interface shows the following key elements:

  1. The Hook column shows the ID of the latest scheduled task.
    The ID indicates the purpose of the task, which, in this case, is to upgrade the plugin settings. Other tasks may import order data for the sales reports, or perform housekeeping duties.
  2. The Status column shows the status of the task, such as pending, in progress, cancelled, and so on.
  3. The Arguments column shows the arguments that are passed to the task during its execution. They are normally needed only for troubleshooting and debugging.
  4. The Group column shows the group under which the tasks are aggregated. In this case, the group matches the ID of the plugin, i.e. the Currency Switcher.
  5. The Recurrence and Scheduled Date columns show, respectively, how often the task will run, and when it's due to run the next time. You don't normally have to worry about that, this information is also used only for troubleshooting.
  6. The Log column shows a log related to the task. If an error occurs, some information may be displayed here. More details can be found in the log generated by the plugin (see section 3. Troubleshooting).


The information on this page should be sufficient to get a good idea of the status process. If you encounter an error, please proceed to the next section to learn how to troubleshoot it.


4. Troubleshooting

All the operations are performed via the Action Scheduler provided by WooCommerce. Should an operation fail, the first place to check would be the Scheduled Actions page. The Log column can show a summary of what a specific task did, and indicate if an error occurred.


If the information on the Scheduled Actions page is insufficient, you can find more details about the background process in the log generated by the plugin. The log file has a name with the following format: woocommerce-aelia-currencyswitcher-[TIMESTAMP].log, where [TIMESTAMP] is a date in YYYYMMDD format. Unless otherwise indicated, logs file are stored in folder wp-content/uploads/wc-logs, and they can be accessed in two ways:

  1. Via FTP. This is the most convenient method, which allows to download a whole log file easily.
  2. At the page located at WooCommerce > Status > Logs. The page shows a dropdown at the top right, where you can choose the log file to inspect. Example below:


The content of the file should include all the warnings and errors triggered by the background process. The information included with them can provided a useful lead to fix them.


Below you can find other resources that are related to the content of this article:

  1. Aelia Currency Switcher - Sales report show lower amounts when the plugin is active


6. Need assistance?

If you have any questions about the upgrade process, or need assistance troubleshooting it, please feel free to contact us, and we will get back to you as soon as possible.