Add database type migration support
GeorgH93 opened this issue ยท 3 comments
Description:
It should be possible to migrate from SQLite to MySQL and from MySQL to SQLite.
Manual SQLite to MySQL migration:
- Change the Marriage Master config to use MySQL
- Start the server (to create the tables), but do not join or let anyone join
- Stop the server
- Download the sqlite tools for your os form the official website: https://sqlite.org/download.html
- Open the database file in the terminal/cmd (
<path to sqlite3 executable> <path to db file>
) - 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;
- Open the users.sql file in an editor and replace all " table " with " marry_players " (without the ")
- Open the partners.sql file in an editor and replace all " table " with " marry_partners " (without the ")
- Open the priests.sql file in an editor and replace all " table " with " marry_priests " (without the ")
- Open the home.sql file in an editor and replace all " table " with " marry_home " (without the ")
- 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
- You should now be able to start your servers again and have all your data.
Manual SQLite to MySQL migration:
- Change the Marriage Master config to use MySQL
- Start the server (to create the tables), but do not join or let anyone join
- Stop the server
- Download the sqlite tools for your os form the official website: https://sqlite.org/download.html
- Open the database file in the terminal/cmd (
<path to sqlite3 executable> <path to db file>
)- 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;
- Open the users.sql file in an editor and replace all " table " with " marry_players " (without the ")
- Open the partners.sql file in an editor and replace all " table " with " marry_partners " (without the ")
- Open the priests.sql file in an editor and replace all " table " with " marry_priests " (without the ")
- Open the home.sql file in an editor and replace all " table " with " marry_home " (without the ")
- 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
- 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