How to move DB and images to different server
-
I had a nice working fog server 1.5.9 running on Ubuntu 20.04. Updating it to 22.04 proved to be a mistake. That’s not the worst part. I could have recovered from that. At the same time the system board failed on that server.
The hard drive data is fine. But I don’t have a DB backup.
I have setup a new server running on Ubuntu 20.04. The original hard drive is connected to it via USB.
How can I get my existing DB onto the new server? I know the images can be copied over. -
@ariederer26 Can you boot that 22.04 image on a different computer? The easiest way is to get 22.04 booted then export the database using the mysql commands.
Yes unfortunately FOG 1.5.9 doesn’t support ubuntu 22.04 just yet. There is an issue with PHP8 that hasn’t been worked out yet. Please stick with 20.04 for now.
-
@ariederer26 You can try copying the whole directory
/var/lib/mysql/
from that mounted external drive to your new 20.04 system and just hope it will come up fine.- Stop database service in the new 20.04 system.
- Rename
/var/lib/mysql/
, e.g. to/var/lib/mysql_empty/
. - Copy old database directory from external disk to
/var/lib/mysql/
as mentioned above. - Match ownership/access rights of copied folders and files.
- Start database service.
- Pray and check log files and/or
journalctl
-
@george1421 I was able to put the hard drive into another computer. I tried running the FOGBackup script. This seems to hang at backing up database. I stopped that. I am now trying to just do a mysqldump. Keep getting permission denied. What credentials am I to use to backup the database? Thank you for the help.
-
@ariederer26 If you know what the root user account is mysql (this is different than the root user for linux) use that user id and password. If not there are instructions on the internet to reset the root user’s password for mysql. That should have full rights.
Also in
/opt/fog/.fogsettings
there should be the user account and password the fog code uses to access the mysql database that account has full read / write access to the fog database too. -
Related article: https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG
-
@george1421 Thank you much for the replies. I haven’t had a chance to steadily work on this. But I cannot get past the permission denied for the life of me. I guess I am confused on the syntax of the command to sqldump. Do I have to execute it as Ubuntu root user? Or myself the only user on the system?
-
@ariederer26 said in How to move DB and images to different server:
Do I have to execute it as Ubuntu root user? Or myself the only user on the system?
In general any Linux/Ubuntu user is able to run mysqldump. But there is a chance you can run mysqldump and not have to provide DB credentials if Run as root.