Friday, May 10, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 725  / 3 Years ago, thu, july 8, 2021, 4:38:54

I just ran into an OS issue, and I was thinking of simply doing a reinstall of Ubuntu. I was looking at the Ubuntu installation options, and I saw that I could "Reinstall Ubuntu 13.04". "Documents, music..... Installed software will be kept where possible. System-wide settings will be cleared."



Originally, I was using this linuxbox for a Wordpress installation, it had the LAMP stack installed. Will MySQL and PHP be kept? Also, will I be able to reinstall without damaging/wiping out the database for Wordpress? Those are the two biggest concerns on my mind right now, and as a Linux noob, I'm really hoping I don't lose those two.


More From » installation

 Answers
5

Your databases will be lost if you reinstall Ubuntu.



If you want to have a .sql file that you can directly import into any system, you can do the following command: mysqldump -u root -p --all-databases > ~/mysql-backup.sql. It will prompt you for the MySQL root (administrative) user password, then dump all the SQL data into the file at /home/USER/mysql-backup.sql (where USER is the user you've logged into)



That file, then, can be used to restore all your database data, so make sure you download it somewhere other than your server. Then, upload that file to the new server in your home directorywhen you want to restore the data, do: mysql -u root -p < ~/mysql-backup.sql



That will restore all your database data and your files.



Remember to back up your website data if the databases are part of a website, and also remember to back up (or download to a place on your computer but not at wherever you're reinstalling) any data you want to keep, as well.


[#30241] Saturday, July 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
taigysel

Total Points: 33
Total Questions: 136
Total Answers: 114

Location: Singapore
Member since Wed, Jan 13, 2021
3 Years ago
;