Page 1 of 1

Restore VestaCP from files

Posted: Fri Sep 04, 2020 10:59 pm
by ralbrightii
I recently had a server crash on me, but I had good system level backups. Unfortunately I am having to move to a new server for various reasons. (Old provider gives little to no support.) What would be the necessary steps to restore a VestaCP install to a new server when ALL i have access to is files/folders? I assume I would install VestaCP on the new server, then just transfer files over from the backups.... but what. And how do I update the IP addresses for everything?

Please help. I am really screwed here.

Re: Restore VestaCP from files

Posted: Wed Oct 21, 2020 11:10 am
by mwlandolsi
Restore or Migrating VestaCP User Data Between Servers
I got the same issue. My VSP crushed and Fortunately, I have a backup of my content saved locally. Just restored my server to a previous snapshot and followed this tutorial from digital ocean.
VestaCP comes with some scripts to help back up and restore user data. We will migrate all users using these scripts.

On the server you are migrating from, use v-backup-users to backup all users:

v-backup-users

Note: If you get a command not found error when running the backup program, you may need to update your PATH by running:

export PATH=$PATH:/usr/local/vesta/bin

This is handled automatically if you log out and back in after installing VestaCP.

The command will output no status information. You can check for the resulting backup files in /backup:

ls /backup

Output
admin.2018-04-11_13-07-02.tar exampleuser.2018-04-11_13-07-02.tar

The above output shows two users backed up, admin and exampleuser. To transfer these files to your new server, we’ll use the scp utility. The following steps will work the same whether you have one backup file or multiple.

If you’re using password authentication on the new server, it’s easiest to transfer the files directly from the old server to the new, like so:

scp /backup/* [email protected]:/backup/

This won’t easily work if you use SSH keys instead of passwords. In that case it’s easiest to download the files to your local machine, then upload them to the new server. We will create a temporary local directory to hold the files first. On your local command line, do the following:

mkdir /tmp/vesta-backups
scp [email protected]:/backup/* /tmp/vesta-backups/
scp /tmp/vesta-backups/* [email protected]:/backup/

Now, with the backup .tar files uploaded to the new server’s /backup directory, log back in to the new server and use the v-restore-user command to complete the process:

v-restore-user admin admin.2018-04-11_13-07-02.tar

Note that the v-restore-user command needs the filename of the .tar file, but not the full path to the file. It is assumed that the filename you provide is in the /backup directory.

The command will output a summary of the items it has restored. Repeat this command for each user you need to restore, replacing the username and .tar file name as need. Your migration is now complete.

From : https://www.digitalocean.com/community/ ... -user-data