Proper backup & restore steps

mailmole

Member
I've tried restoring my mailwizz with my backup but frankly I didn't find the current guidelines thorough so I thought of starting a thread to go through it. Can someone who's had experience with restoring the backup share the steps they took?

Currently, I tried uploading backup.tar.gz to the tmp folder of the mailwizz directory on a new server. However, I got some error due to the sql database. All I had from the previous mailwizz was that tar.gz file. If there was anything else needed for restoring the backup, is it ppossible to list it here together with the correct list of steps so it's clear and all-inclusive?
 
@mailmole - additionally to what @laurentiu said, when you decompress a backup archive, you get the app files and the app database. The app files must be moved in your site public location while the app database must be imported in mysql.
 
@twisted1919, I was already familiar with the article. If it was clear, I wouldn't have had to start this thread. Consider me a newbie but I hope this will help anyone else who might find self in such situation :)

The app files must be moved in your site public location
Do you mean it should be moved to the mymailwizz folder in var/www/ ? This is the current path where the installed mailwizz folder is placed

With regards to the article, I still don't understand the following step:
wget http://www.mailwizz-old.com/tempdownload/backup.tar.gz
wget http://www.mailwizz-old.com/tempdownload/backup.sql

Where does it come from, what does it do, and how do I find backup.sql?

Also, should I create a mysql database on the new server before importing the backup?

BTW, if backups are programmed to be deleted, are they permanently deleted? In other words, do they still take any space after being deleted? Is the situation same with deleting the delivery and bounce logs?
 
Last edited:
was already familiar with the article. If it was clear, I wouldn't have had to start this thread. Consider me a newbie but I hope this will help anyone else who might find self in such situation
fair enough :P

Do you mean it should be moved to the mymailwizz folder in var/www/ ? This is the current path where the installed mailwizz folder is placed
Yes. When you move the files from a server to another you don't do a fresh install, instead, you simply take the app files which you have backend up and you place them in the new server in the public location so you can access them.

With regards to the article, I still don't understand the following step:
wget http://www.mailwizz-old.com/tempdownload/backup.tar.gz
wget http://www.mailwizz-old.com/tempdownload/backup.sql
These are simply examples. backup.tar.gz is the archive containing the files and backup.sql is the one containing the database. Again, they are purse examples to let you know you need to get the two archives from the old location into the new one.

Also, should I create a mysql database on the new server before importing the backup?
Yes. Otherwise it won't work.

BTW, if backups are programmed to be deleted, are they permanently deleted?
Yes, they should.
 
@twisted1919 Thanks for going through my reply point by point.

Yes. When you move the files from a server to another you don't do a fresh install, instead, you simply take the app files which you have backend up and you place them in the new server in the public location so you can access them.

Ok, so this is how it looks like when I think of it:
1. Move backup.tar.gz to var/www
2. Untar the backup folder
3. Move the apps folder from inside the untarred backups folder to var/www
Is that right?

These are simply examples. backup.tar.gz is the archive containing the files and backup.sql is the one containing the database. Again, they are purse examples to let you know you need to get the two archives from the old location into the new one.

Ok, but this is where I begin to wonder why backup.sql is mentioned separately. We only have backup.tar.gz for restoring the old mailwizz. So where does backup.sql come from? Do I need to have it and import it together with backup.tar.gz?
 
@twisted1919, in addition to my reply above, I went ahead and tried to again restore my mailwizz with the backup and ran into the following issue:

upload_2019-3-20_22-18-24.png

I've tried with 4 different backup files to no avail.

I also tried ignoring this and going on with the sql command:

mysql -u admin -p mailwizz < database.sql​

This was the outpput:

ERROR 1064 (42000) at line 3799: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1​

It seems to me that the backup manager is producing corrupt backup files. Do you have any suggestions for how to proceed? What is the point of having a backup manager if its files are corrupt and don't lead to proper restore?
 
As far as we are aware so far, the backup manage does not produce broken files, it would beat the purpose of the backups if it did, as you say.
To make sure all is okay, i just downloaded(from the web interface) a backup from one of our installed apps and tried to decompress it:
Screenshot 2019-03-21 17.35.36.png
As you see, it does work just fine.

Backups, actually files, can get corrupted for various reasons, incomplete transfer might be one fo the causes, so you might try to get the file once again.
Also, different versions of the tar command might cause the issue as well, so maybe decompress it on same server where you compressed it.
 
Back
Top