Example How do I have a copy with yesterday's data every morning?
If you test daily, reproduce support cases or build reports, you do not want to refresh by hand every morning. A schedule does it at night.
A copy ages quickly.
After a few days the copy lacks the new orders, products and customers. A support case from today cannot be reproduced in it, a report shows old figures.
A nightly "Refresh data" fetches only the database anew and leaves the copy's code, themes and media in place. In the morning the copy has the state of the night, anonymized as always.
Step by step in the administration.
- Switch the schedule onIn the tab "Schedule", "Schedule active", "What the scheduled run does" on "Refresh data", "Repeat" on "Daily".
- Choose the timeAn hour when little happens in the live shop, 03:00 for instance. The run starts in the first minutes after it.
- Keep the copy's settingsWhatever should always differ in the copy you set before the first build in the "System configuration" in the tab "Setup"; it is set again on every run.
- Notify on failuresIn the Flow Builder, review and switch on the shipped flow for "Staging: Run failed".
- Keep an eye on itThe scheduler shows all schedules with the next run and the result of the last one.
More on this:Schedule and automationWhat gets copiedServices and plugins
What gets overwritten at night.
- Every refresh replaces the copy's database. What you set in it during the day is gone the next morning, unless it is in the system configuration of the staging environment.
- Shopware runs the tick as a scheduled task. For that the live shop needs a worker, a console worker or an open administration, and "Carry runs in the background" has to be on.
- If a run is still open at the scheduled time, that slot is skipped and not made up.
- After a refresh the image files of new products are missing, because new files only come with "Rebuild". If you need them, set the schedule to "Rebuild" or rebuild by hand now and then.
What shop owners ask about it.
Does the nightly refresh slow down the live shop?
It reads the live shop in small slices. Choose an hour when little happens, and if needed set a smaller slice size in the plugin settings.
Can one staging environment refresh daily and rebuild weekly?
A staging environment has one schedule with one kind of run. For both rhythms use two staging environments, one with "Refresh data" daily and one with "Rebuild" weekly.
What if the refresh fails at night?
The staging environment is marked "Failed", the run window says in which step and why, and until a new run succeeds the copy shows a lock page. The shipped flow for "Staging: Run failed", once switched on, tells you in the morning.
More examples
-
The Shopware update
The update in the copy first, in maintenance mode if you like, and only then in the live shop.
-
Testing a new plugin
Set up a new plugin or theme calmly; the comparison shows what you have to repeat live.
-
Access for the agency
Address, password and an admin login of its own, only for the copy and only until the agreed date.
-
Testing an interface
Block and log calls from apps and webhooks first, then let them through on purpose.
-
Documents with real orders
Design invoices and delivery notes on real, anonymized orders.