How To Create Scheduled Tasks In Shopware 6
Below, we explain how to optimize your daily workflow, reduce system load, and gain extra productivity with your daily duties in Shopware 6. We dive deep into Shopware scheduling, explaining how to configure scheduled tasks for periodic execution. The system lets you schedule various processes, redistributing load more efficiently between your administrators and over time. You will also discover the role of messenger queue server-controlled processing. After that, we will proceed to scheduling import and export processes in Shopware 6. You can find more Shopware tutorials here.
Note that we provide Shopware integration with external platforms. Contact our support for further information or try our Improved Import, Export & Mass Actions.
Table of contents
- 1 Shopware 6 Scheduling
- 2 How to configure scheduled tasks for regular execution in Shopware 6
- 3 Messenger queue server-controlled processing
- 4 How to create scheduled import/export tasks in Shopware 6
- 5 Shopware 6 Essentials FAQ
- 5.1 How to create a Shopware account?
- 5.2 What about a Shopware ID?
- 5.3 What is Shopware master data?
- 5.4 How to add a new Shopware shop?
- 5.5 How to add a payment method to your Shopware account?
- 5.6 How to create a deposit in Shopware?
- 5.7 How to purchase Shopware extensions?
- 5.8 How to get support in Shopware?
- 5.9 How to automate import and export processes in Shopware 6?
- 5.10 How to migrate to Shopware 6?
- 5.11 How to integrate Shopware 6 with external systems?
Shopware 6 Scheduling
Shopware 6 executes many update functions as background processes in the browser, using a message queue. When a user logs in to the administration, the system initiates the updates, causing performance losses that rise with the number of logged-in users who work simultaneously. However, there is a possibility to reduce the load dramatically with the help of schedules.
Furthermore, some tasks should be performed at a specific time; therefore, they cannot be run from the message queue. For instance, you cannot launch product export for comparison portals every time an administrator logs into the system. It is necessary to follow a schedule.
Shopware 6 lets you apply changes necessary for scheduled tasks right on the server. Since server configuration depends on the hoster, you may need to reach the corresponding support department to implement scheduling correctly. As for import and export processes, you can create Shopware 6 scheduled tasks for them with a third-party extension.
How to configure scheduled tasks for regular execution in Shopware 6
You need to set up a cron job on the server to perform scheduled tasks. According to the official documentation, the best option is to set it up for recurring execution every 5 minutes. Use the following command to configure scheduled tasks for regular execution in Shopware 6:
1 |
php /pfad/zu/Shopware/bin/console scheduled-task:run --time-limit=295 --memory-limit=512M |
Where:
- “–time-limit=295” is responsible for executing the task every 295 seconds. It is finished when the new execution starts after 5 minutes.
- “–memory-limit=512M” sets the limit on the maximum memory use – 512 MB. Thus, you prevent the RAM from filling up.
As we’ve already mentioned above, the cronjob setup in shopware 6 varies depending on the hoster. Therefore, get further information from your hoster. Note that it may be more efficient to outsource the above command to a script and include it in the cronjob in some cases.
Messenger queue server-controlled processing
There is no need to run the messenger queue through the background processes of the browser. Shopware 6 provides an alternative approach for that. Below, you will find an additional way to implement Shopware 6 scheduled tasks.
Turn off the admin worker
First of all, you need to disable the execution of the standard browser background process. Find the shopware.yaml file situated in your Shopware installation under /config/packages. Create it if the file is not available there. Add the following snippet to the file:
1 2 3 |
shopware: admin_worker: enable_admin_worker: false |
Now, empty the shop cache with this command:
1 |
php bin/console cache:clear |
Remember that you need to execute it directly on the server via SSH to create Shopware 6 scheduled tasks.
Set up message queue for processing
Since the message queue should run continuously, restart the command every 5 minutes. Use the “–time-limit=295” addition to reduce the number of parallel processes executed in the long run. This command will help you set up a message queue for processing:
1 |
php /pfad/zu/shopware/bin/console messenger:consume --time-limit=295 |
What about the memory limit, you will ask? It can interrupt processes at an early stage. Therefore, it is not recommended to set it at this point if you want to implement Shopware 6 scheduled tasks successfully.
How to create scheduled import/export tasks in Shopware 6
We’ve already mentioned above that you can create scheduled import and export tasks in Showpare 6 with the help of a third-party extension. It would help if you had the Improved Import, Export & Mass Actions module since it can implement schedules for transferring information between your e-commerce website and any external system. Choose what data you want to import or export and specify an interval to launch the transfer. That’s it!
You may also use mapping to match external data to the requirements of Shopware 6 and vice versa. Contact our support for further information.
Shopware 6 Essentials FAQ
How to create a Shopware account?
You need to create a Shopware account before creating any Shopware 6 scheduled task. Visit the registration page, hit the Register Now link, and fill in the form to create a new account. After receiving a confirmation email, follow the instructions provided in it.
What about a Shopware ID?
You will get your Shopware ID upon registration automatically.
What is Shopware master data?
We assume that all the information about your company and business, including physical addresses, phone numbers, and emails, is stored within the system as Shopware master data.
How to add a new Shopware shop?
You need to create a Shopware shop to enable scheduled tasks. It is possible to add it in your merchant area. Click the corresponding link, choose the type of your new shop (a cloud storefront or an on-premise installation), and provide all the information the system requires.
How to add a payment method to your Shopware account?
It is necessary to add a payment method to your Shopware account to use it for internal purposes. You can do that under Basic Information -> Accounting. Select PayPal, credit card, or direct debit as a way to transfer funds to your account.
How to create a deposit in Shopware?
A working payment method enables you to create a deposit for purchasing extensions and themes. Go to your Merchant Area -> Shops, choose a shop to provide funds to, click Open Account Details, and transfer a deposit that covers the amount of your purchase.
How to purchase Shopware extensions?
You can purchase extensions and themes in the Plugin Manager. Alternatively, it is possible to do that on the Shopware Marketplace. Create a deposit in advance that equals the amount of your future purchase. Next, select a tool you want to buy and complete the checkout.
How to get support in Shopware?
You can send inquiries regarding accounting and financial inquiries to financial.services@shopware.com and +49 2555 9288 510. License inquiries are stored here: info@shopware.com or call +49 2555 9288 50.
How to automate import and export processes in Shopware 6?
As we’ve just mentioned above, the Improved Import, Export & Mass Actions extension supports scheduled import and export processes, so it is developed to automate recurring data transfers. The module will help you create schedules to launch the corresponding import and export processes automatically.
How to migrate to Shopware 6?
Also, the Improved Import, Export & Mass Actions tool is suitable for migrating to Shopware 6. It can help you transfer data from your existing website to the new platform. You won’t need to create a schedule for the migration but can automate various data transfers. The tool lets you migrate from other e-commerce systems or Shopware’s previous versions. Note that we also offer export solutions for systems like Magento and Shopify, so you can simplify your data transfers between them and Shopware.
How to integrate Shopware 6 with external systems?
Shopware 6 integration with ERPs, CRMs, accounting tools, and other similar platforms is based on scheduled data transfers. Therefore, another strong point is associated with the Improved Import, Export & Mass Actions plugin. As we’ve already mentioned, the module can help you automate repetitive import and export processes. Also, it introduces mapping presets to help you modify data according to the requirements of your Shopware store during import. Also, the extension can help you follow the rules of the connected platform during export.