How to create a backup of ViMP?

Editions: Light, Community, Professional, Enterprise, Ultimate, Corporate
Versions: all

The following article describes how to create and roll back a backup of a root server hosting on the shell or console.  

The target is to backup the ViMP installation with all of its files and its database. Before an update of your installation you should also always make a backup of the complete system.

The backup creation includes two tasks:

  1. Save the database (MySQLdump)
  2. Create an archive with all files

In the following we assume that you are in the ViMP installation folder.

Creating the backup

We save the database (MySQLdump)

mysqldump -u databaseuser -p --opt databasename  > dumpfilename

We save the files to an archive (backup.tar.gz)

tar cvzf backup.tar.gz *

That's it. We just created an archive with all files and the database dump inside.

The archive can now be moved to another server or local machine via FTP or SFTP or you can move it to another folder on your webserver.


Let's roll back the data.

If you need to roll back the data, copy backup.tar.gz back into the ViMP installation folder first.

Extracting the backup

tar xvzfp backup.tar.gz 

If you are root, the 'p' option is not needed necessarily. Otherwise it maintains the file permissions and is very important, because we assume you don't want to set all permissions anew manually.

If the files shall belong to another user than perviously, use chown:

chown -R username:groupname*

With Debian it is:

chown -R www-data:www-data *

We import the database dump:

mysql -u databaseuser -p databasename  < dumpfilename

Of course you can also import the dump into any other database with other access data.

Last update on 2017/05/15 by Admin.

Go back