Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So this is more of a theoretical question (will be put into practice if this is possible).
I'm working with Plesk and a Virtual Private Server. They have the option to do a re-install (in case things get too broken or what have you). I'd like to be able to access the old database (it's called psa and would be located in /old/var/lib/mysql/psa) via the mysql command to get data from there.
Is it possible to do this? I was thinking of using a socket, but since the mysql service would be started from the new installation, would the old installation even have a socket?
I *do not* want to copy the database over to the new folder for several reasons. The first is that it's an InnoDB and I think I'd have to also copy over the ibdata stuff. More importantly, there is a fresh copy of the psa database that would be created and I DO NOT want to overwrite this.
Depends what you need, but start with pointing the mysql.conf at the old DB and extracting what you need to a flat file.
Then point stop MySQL, point the conf file at new DB and away you go.
That assumes it's a one off operation at re-install.
If you want continuous access, then mysqldump the old DB, edit the file (its just text) to have a new schema name eg old_whatever, then re-import into the new DB.
Well, more than likely, I will have to generate a bash script that will execute Plesk code to re-add all the information, but that is not really a problem. Just for clarification, I would be modifying the datadir variable, correct? Additionally, this would require me to login using the information from the old installation as well, right? (I'm assuming so, since it will be referencing the older mysql users table, but just want to clarify).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.