PyvesB / advanced-achievements

:fireworks: Popular plugin that adds unique and challenging achievements to Minecraft servers.
https://www.spigotmc.org/resources/83466
GNU General Public License v3.0
200 stars 214 forks source link

way to migrate from .db to mysql #1024

Closed hkkongou closed 3 years ago

hkkongou commented 3 years ago

:information_source: Basic information

:question: Help request

Is there a way to convert .db player data into mysql database? i have 1 server, i have been using advanced achievement for half year and the achievements.db is having alot of player data, i would like to make new server and sync the achievement progress by mysql, but i found out that if i directly change the storage method to mysql, it does not convert, it only generate new file in mysql database, all player achievement progress are still staying in the .db file.

:wrench: Configuration

config.yml https://paste.gg/p/anonymous/10e640ad47ef4aa480ef90b09c434d32

PyvesB commented 3 years ago

Hello @hkkongou ! : wave:

This sounds like a duplicate of #927, let me know if it helps. 😉

hkkongou commented 3 years ago

Hello @hkkongou ! : wave:

This sounds like a duplicate of #927, let me know if it helps. 😉

i have read the ticket you mentioned i tried the 2nd one which is https://github.com/pedromartins4/H2-to-MySQL however, even it show successfully exported to mysql, i see nothing in the database : (

PyvesB commented 3 years ago

Maybe worth raising an issue with the author of that script, or trying one of the other tools?

hkkongou commented 3 years ago

Maybe worth raising an issue with the author of that script, or trying one of the other tools?

i have tried the first method but it require the H2 database's password and username, but i don't know that. i also tried the software called "Full Convert", but it cannot detect the tables in achievements.db

hkkongou commented 3 years ago

Maybe worth raising an issue with the author of that script, or trying one of the other tools?

now i got the 2nd method write but it say wrong user name or password? can you tell me what is the username or password for the achievements.mv.db file?

PyvesB commented 3 years ago

Advanced Achievements doesn't use a username and password for H2 databases. The following StackOverflow answer will probably work: https://stackoverflow.com/a/8695432/3527464

hkkongou commented 3 years ago

Advanced Achievements doesn't use a username and password for H2 databases. The following StackOverflow answer will probably work: https://stackoverflow.com/a/8695432/3527464

just tried with no username and password, it can connect, however, the program end within 1 second. later on i used a db visuallier and i found out that there are 0 tables in the file, not sure am i opening the file right, or is the file already corupted. However, the file have been normally running over 6 months. i have no clue what happened to the file, is it working or not

https://drive.google.com/file/d/1xnQtcCwF9MYuBo3DrF35TELDoa88QdRL/view?usp=sharing

PyvesB commented 3 years ago

The file looks okay to me, I can run it with my local Advanced Achievements setup. Exploring the data using the DBeaver tool works fine as well. :)

hkkongou commented 3 years ago

The file looks okay to me, I can run it with my local Advanced Achievements setup. Exploring the data using the DBeaver tool works fine as well. :)

you are right, i can read the database using DBeaver tools too after these all digging, i finally can convert the data from H2 to mysql, thank you so much

For new people need the steps, i will write it here... and some tips

the correct file to open should be achievements.mv.db , not achievements.db username and password are null (nothing) *some conversion software may require a username and password other than null, so may need dbeaver tool to open the H2 database, since it allow users to login H2 database without password, and then can make a new user account with any username you want and password.

and the steps for me: 1.download dbeaver tool and install it 2.open the software, select "H2" format

  1. open achievements.mv.db, which no password and username
  2. create a new admin user and a password
  3. use any tool that support auto conversion from H2 to mysql, in my case i use Full convert trail( it require username not null) https://www.fullconvert.com/howto/h2-to-mysql
  4. connect the mysql using full convert and do the step as above.
  5. set up config.yml of AACH, with mysql type and no TablePrefix, ""

extra reminder, for the second method, the python one, does not work for me : (

PyvesB commented 3 years ago

Glad to hear you've completed the conversion, thanks for documenting some of the steps!