Marriage Master

Marriage Master

4M Downloads

Add database type migration support

GeorgH93 opened this issue ยท 3 comments

commented

Description:

It should be possible to migrate from SQLite to MySQL and from MySQL to SQLite.

commented

Manual SQLite to MySQL migration:

  1. Change the Marriage Master config to use MySQL
  2. Start the server (to create the tables), but do not join or let anyone join
  3. Stop the server
  4. Download the sqlite tools for your os form the official website: https://sqlite.org/download.html
  5. Open the database file in the terminal/cmd (<path to sqlite3 executable> <path to db file>)
  6. Execute the following commands:
.mode insert
.output users.sql
select * from marry_players;
.output partners.sql
select * from marry_partners;
.output priests.sql
select * from marry_priests;
.output home.sql
select * from marry_home;
  1. Open the users.sql file in an editor and replace all " table " with " marry_players " (without the ")
  2. Open the partners.sql file in an editor and replace all " table " with " marry_partners " (without the ")
  3. Open the priests.sql file in an editor and replace all " table " with " marry_priests " (without the ")
  4. Open the home.sql file in an editor and replace all " table " with " marry_home " (without the ")
  5. You should now be able to import the sql files into your mysql database. Make sure that the players table is empty and all your servers are turned off before you start. While importing make sure to keep the order the following: users.sql, priests.sql, partners.sql, home.sql
  6. You should now be able to start your servers again and have all your data.
commented

Manual SQLite to MySQL migration:

  1. Change the Marriage Master config to use MySQL
  2. Start the server (to create the tables), but do not join or let anyone join
  3. Stop the server
  4. Download the sqlite tools for your os form the official website: https://sqlite.org/download.html
  5. Open the database file in the terminal/cmd (<path to sqlite3 executable> <path to db file>)
  6. Execute the following commands:
.mode insert
.output users.sql
select * from marry_players;
.output partners.sql
select * from marry_partners;
.output priests.sql
select * from marry_priests;
.output home.sql
select * from marry_home;
  1. Open the users.sql file in an editor and replace all " table " with " marry_players " (without the ")
  2. Open the partners.sql file in an editor and replace all " table " with " marry_partners " (without the ")
  3. Open the priests.sql file in an editor and replace all " table " with " marry_priests " (without the ")
  4. Open the home.sql file in an editor and replace all " table " with " marry_home " (without the ")
  5. You should now be able to import the sql files into your mysql database. Make sure that the players table is empty and all your servers are turned off before you start. While importing make sure to keep the order the following: users.sql, priests.sql, partners.sql, home.sql
  6. You should now be able to start your servers again and have all your data.

i can't find all .sql
i typed these command and i am stuck here
plz help, thank you
image

commented

The will be in the directory where you run the command from.
In your case that would be C:\Users\Kelvin