Restoring a customer website.

Bluejet

Verified User
Joined
May 25, 2022
Messages
23
I have a customer who hosed his site and wants me to restore it. I have the backup created by direct admin, I am not sure if I just ftp it to his domains folder or if there is a restore function in direct admin.

It is a wordpress site and I did backup the database too. He deleted plugins and is now getting fatal error, so I would assume if I just replace the files from the last backup it should work.
 
Last edited:
It's a backup created by direct admin, but is ftp'd to a backup server. I have downloaded the backup and un-compressed it.
 
Your users can make and restore their own backups. If they made them...
 
Your users can make and restore their own backups. If they made them...
Yeah I tell them that all the time, but this person didn't. Uffta!
 
Then you can restore on admin level. However it will overwrite everything, so probably also new mails.

You can also just unpack the tar.gz file and restore database and public_html folder only.
 
Then you can restore on admin level. However it will overwrite everything, so probably also new mails.

You can also just unpack the tar.gz file and restore database and public_html folder only.
Thank You. Real newbie here. Unpack and upload public_html and database, but not confident enough to know if I can restore the database correctly.
The other way is I did upload the tar.gz file to admin_backups and it shows in the list, but it doesn't ask me where I want the restore to go except to the I.P. of the shared server. I know that is correct, would assume it would know what folder to restore into. Correct?
 
but not confident enough to know if I can restore the database correctly.
Ah oke, I understand, that is something we can help you with.

You could as root via SSH create a temporary directory under root, like /root/temp and then copy the tar.gz in there and extract it.
You can also unpack it with winrar on your pc and then upload the needed files via FTP.

Also the mysql backup, you can place somewhere on the account. There are a couple of ways to restore the backup.
First use phpmyadmin or Directadmin itself and delete the current mysql database, create a new one, if possible with the same name and password which was used before, or in phpmyadmin just delete all content of the database.

Then restoring:
1.) Use phpmyadmin to import the .sql file into the database you selected.
2.) Use a mysql command as root to import the restore the database, which can be done like this:
mysql -uUSERNAME -p DATABASENAME < /path/to/the/backup.sql

for -p you will get the password asked as soon as you press enter.
You can also check /usr/local/directadmin/conf/my.cnf for the da_admin user and password, this can be done too, you would get the command like this:
mysql -uda_admin -p DATABASENAME < /path/to/the/backup.sql
still you have to replace DATABASENAME (does not need to be in capitals) with the name of the databasename and ofcourse change the path to the backup sql file to where you have placed it.

but it doesn't ask me where I want the restore to go except to the I.P. of the shared server.
No it doesn't indeed, but it's fairly easy. It always restores to the accountname. So for example the backup file is named:
user.admin.john.tar.gz

Then the account will be placed with admin as the creator, and all restoring will be done under /home/john so if john has a domain name imjohn.com then after restore it would be found in:
/home/john/domains/imjohn.com/public_html
so this is the way you can see where it is restored. If you want to restore it to /home/peter then you should rename the .tar.gz file accordingly. But be aware, things will be overwritten, including all passwords, with the one from the backup.

Als except for the IP address, take care that the new DNS/nameservers are used from the current server and not the ones from the backup unless it came from the same server.
 
There is 1 other way to restore, maybe better because when you restore as user, you can select to only restore website and database.

suppose your backup is now named user.admin.john.tar.gz then rename it to for example backup-Jul-20-2022-1.tar.gz and place it in the users backup directory for example /home/john/backups if all is well.
Then login as the user, and use the restore function from there. Should also work and then you can select to only restore database and website.
 
ok. just had a heart attack. I configured the restore as admin to the account, but when I clicked on more setting or advanced or something like that (after clicking restore) it said all users except checked and admin was checked. I aborted it as I am thinking it will overwrite the other users? I am soo scared I am going to screw something up. My heart was nearly pounding out of my chest.

During the process it only asks what file to restore and I check it. Then I tell it to restore to the shared server and the correct I.P., after that I say what reseller, but it doesn't say anything about users until after I click submit. That is what is freaking me out.
 
Last edited:
ok. just had a heart attack.
Whoehahahaha. ?? ?
Sorry, but that reminds my of the times that I just begon and same as you, had my doubts and lack of confidence too. I had a couple of those feelings in my time. So don't worry, you're not alone. :)
However.... I've had one even a couple of years ago when something went down the drain with my mysql server. LoL.
So be sure, I'm not laughing at you, I'm laughing because I totally get the feeling you got.

I configured the restore as admin to the account,
Just to be sure... you used the admin backup/transfer option right? Or what do you mean by this?
I can't remember having extra questions or seeying some advanced screen? Could you do a screenshot of what you mean?

I normally only select the file and need to press submit and that was it. However I still use the older enhanced skin, makes my live a bit easier in some cases.
 
Just to be less worried... might be best for you to, for now, use the last option, rename and then use the user restore option.
 
I am so sorry for the confusion. I was looking at the wrong screen I forgot I had two direct admin windows open in separate tabs. I restored it with direct admin and the admin restore. All worked without a hitch.
 
Back
Top