Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from older database servers #4

Open
NattyNarwhal opened this issue Jul 16, 2021 · 2 comments
Open

Migration from older database servers #4

NattyNarwhal opened this issue Jul 16, 2021 · 2 comments

Comments

@NattyNarwhal
Copy link

This is lightly touched on (mysqldump is mentioned once), but this is probably pretty important for people i.e. stuck on ZendDBi.

I would put it something like, considering that the way I write tutorials is significantly different (comments in <>):


You first want to dump the old database using mysqldump. This will dump out the database into SQL DDL/DML. You'll probably want to use the database's root account, as that has permission to dump everything in the database.

We'll dump all databases, since that's what you likely want when migrating or backing up. (If you want to only dump specific databases, use --databases foo bar xyzzy .... Other options are more contextually dependent and out of scope for this article.) In addition, it may make sense to use the old mysqldump command too, so we'll explicitly specify it. <XXX: the path to the binary for zenddb/old zend server> Run the following, adjusting as needed for your old MySQL setup <XXX: perhaps ports?>:

$ /path/to/bin/mysqldump -u root -pPASSWORD --all-databases > path/to/dump.sql

Since mysqldump outputs the SQL to standard output, we'll redirect it to a file. Said file also functions as a backup of your database; it might be good to get in the habit of running it on your new database too!

[...]

Once the server is set up, we can restore any old database dump. Since the dump is just SQL, we can easily restore it using the mysql command, which takes in SQL.

We'll run the following, adjusting as needed for your MariaDB setup <XXX: perhaps ports?>:

$ # We'll specify the absolute path to make it obvious that this is new MariaDB
$ /QOpenSys/pkgs/bin/mysql -u root -pPASSWORD <  path/to/dump.sql

The contents of your old database should now be available.

@alanseiden
Copy link
Contributor

alanseiden commented Jul 27, 2021

We should add a note to say that with IBM's MariaDb, table names become case-sensitive. Here's why:

  • mariadb hosts DB/table files in IFS
  • old mysql put them outside QOpenSys
  • new mariadb does put them in QOpenSys (a case-sensitive file system), so now table names are case-sensitive.

@richardschoen
Copy link
Owner

If you guys can provide some specific verbiage on what you would like to see changed and issue a pull request that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants