How do I create a backup with Shopware

A backup is like a good insurance policy. You don’t realize it’s missing until you need it most. Especially for an online store, where many changes occur every day, you should have a good backup strategy and back up your data at least daily. If possible, you should create database back ups even more often.

The important thing is that you take care of your backups personally. Even if your hoster or agency says that they do backups themselves – with your backups you have it in your own hands and can react faster in case of problems. Your hoster will probably need something, this can waste precious time.

We’ll show you here how to create backups in Shopware 5 and Shopware 6, and restore them when needed.

Backup in Shopware 5 and Shopware 6

By default, it is unfortunately not possible to create backups in Shopware 5. This requires paid plugins like Stageware Staging & Backup or access to the server via SSH.

The plugin solutions are useful in that they are very easy to use. With just a few clicks, a backup is created and, if in doubt, restored. The prerequisite is, of course, that the store itself is still running and the backend is also accessible.

The backup via SSH requires some knowledge. Either you deal yourself sufficiently with the operation of Linux over the console before or leave this matter to a professional.

Access via SSH

As a Windows user, you first download a tool like putty. Mac and Linux users can simply take the terminal. To establish access, SSH access must be set up, this is not the case with all providers. If in doubt, just ask what the data is.

In the terminal you enter “ssh benutzer@hier-kommt-eine-webadresse-hin”, whereupon the access data are requested. With putty you enter this web address directly in the first window above and click on Connect. The data is then queried.

You will now switch to the store directory. Under Linux this is done with the command “cd”. You may have to ask your provider for the exact folder, usually it is /var/www/shopname. So you change by the command “cd /var/www/shopname/” into the correct directory and execute here the command “ls” (LS for LIST). Create a backup folder by typing “mkdir backup”. Note that the case is case sensitive here. “mkdir backup” and “mkdir backup” create two different folders.

Your store consists of two components, roughly speaking. The files and the database. The files provide the basic framework and design, the database stores the articles and all other texts. So you have to backup both components in a full backup.

Database backup

Backup the database with the command “sudo mysqldump -uroot -p databasename > backup/dbbackup.sql *” – first your login password will be requested, then the database password. Depending on how big your store is, it may take a while to back up the database. If possible, you should make this backup outside of your store’s normal hours of use so that your visitors don’t notice.

File backup

You should compress the backup so that no memory is wasted and the transfer to your computer is faster. The command “tar -cvzf backup/backup_datum.tar.gz shopname/” creates the backup and saves it in the folder you created. Again, depending on the store size, this may take some time.

Transfer the backups to your computer

Leaving a backup just like that on the server is a no-go. At the latest in the database backup are customer data, which are quite easy to view, should someone get on your server, even if it is only by accident.

Now you call the command “rsync –exclude=’shopname/var/cache/production_*’ –exclude=’shopname/media’ -av user@webaddress:/var/www/shopname/backup /localpath”.

Looks a bit wild, but is quite logical: rsync stands for RemoteSync and synchronizes the content you specify with a local folder on your computer. -exclude omits cache and media files that only create unnecessary ballast. We still know the user@web address from the login. Then comes the path to the backup and finally where the whole thing should go.

Recovery

If the case should become necessary, you restore the data over these commands (and please only then!):

Log in via SSH and change to the folder /var/www. Here you execute the command “mysql -uroot -p < backups/dbbackup.sql *” for database recovery. To restore the files, run the command “tar -xvzf backups/backup_datum.tar.gz *”.

Note that all old data is overwritten here without confirmation.

Create backup with Shopware

A backup in Shopware is not possible without plugins or at least basic system knowledge, or at least not useful. Since you are always handling your store and user data here, you should have appropriate knowledge or commission someone to do so.

As a Shopware agency, we set up regular backups for you so you can sit back and relax. Why not arrange a free initial consultation right away?

  • 0/5
  • 0 ratings
0 ratingsX
Very bad! Bad Hmmm Oke Good!
0% 0% 0% 0% 0%

Haben Sie Fragen oder brauchen ein individuelles Angebot? Zögern Sie nicht, uns zu kontaktieren.


    eBakery requires the contact information you provide to contact you regarding our products and services. You can unsubscribe from these notifications at any time. For information on unsubscribing, as well as our privacy practices and commitment to protecting your privacy, please see our Privacy Policy.*.

    Related Posts

    Leave a Comment

    Hat dir der Artikel gefallen?

    Dann melde dich doch zu unserem Newsletter an!

    Neben unseren Blog Themen informieren wir dich darin regelmäßig zu neuen Features und Tutorials