-
Notifications
You must be signed in to change notification settings - Fork 2
Migration from 0.x.x to 1.x.x
- Migrate MongoDB first using steps below
- Make sure server is off
- Rename config file
msdatasync.conf
tomsdatasync_old.conf
- Put 1.x.x jar into mods or plugins folder and remove the old version
- Start server
- Open both config files
msdatasync.conf
(the newly generated one) andmsdatasync_old.conf
in a text editor - Copy settings over where appropriate (structure changed slightly) and save file
- Run
/sync reload
or restart server - Done!
(while your server is off, and before you turn on the server with the new version):
-
mongo -u <user> -p <password> <hostname>/<database>
(e.g.
mongo -u dbuser -p abadpassword 1.2.3.4/msdatasync_server1
)Should look something like this after you run it:
MongoDB shell version v4.0.3 connecting to: mongodb://1.2.3.4:27017/msdatasync_server1 Implicit session: session { "id" : UUID("...") } MongoDB server version: 4.0.12
-
use <database>
(e.g.
use msdatasync_server1
)Should look something like this after you run it:
switched to db msdatasync_server1
-
db.members.updateMany({}, {$set: {className: "rocks.milspecsg.msdatasync.model.core.member.MongoMember"}});
-
db.snapshots.updateMany({}, {$set: {className: "rocks.milspecsg.msdatasync.model.core.snapshot.MongoSnapshot"}});
-
db.snapshots.updateMany({}, {$set: { "itemStacks.$[].className": "rocks.milspecsg.msdatasync.model.core.serializeditemstack.MongoSerializedItemStack"}});
That's it!
To confirm that it worked, run db.members.find({}).limit(1).pretty();
. The result should look something like this:
{
"_id" : ObjectId("5dd713aa36a7d03b572a3dc5"),
"className" : "rocks.milspecsg.msdatasync.model.core.member.MongoMember",
"userUUID" : BinData(3,"cFlfWZo7VQ7J1TNcJBxerA=="),
"updatedUtc" : ISODate("2019-11-21T22:46:02.569Z"),
"snapshotIds" : [
ObjectId("5de83bf7b19d425d2a9053db"),
ObjectId("5debc84f6edc07657d51709c"),
ObjectId("5ded54cf4ac8ed4c0250467a"),
ObjectId("5df050378597da280a8de7cc"),
ObjectId("5df051258597da280a8de7d3")
]
}
And for snapshots, run db.snapshots.find({}).limit(1).pretty();
, which should look something like this:
{
"_id" : ObjectId("5de81bcaeddf697a65346e4a"),
"className" : "rocks.milspecsg.msdatasync.model.core.snapshot.MongoSnapshot",
"name" : "Auto",
"server" : "spawn",
"modulesUsed" : [
"msdatasync:experience",
"msdatasync:gameMode",
"msdatasync:health",
"msdatasync:hunger",
"msdatasync:inventory"
],
"keys" : {
"saturation" : 5,
"total_experience" : 0,
"game_mode" : "SURVIVAL",
"health" : 20,
"food_level" : 20
},
"itemStacks" : [
{
"className" : "rocks.milspecsg.msdatasync.model.core.serializeditemstack.MongoSerializedItemStack",
"properties" : {
"ContentVersion" : 1,
"ItemType" : "openblocks:info_book",
"UnsafeDamage" : 0,
"Count" : 1
}
},
... (not including all 41)
]
}
(Make sure the property className
matches in all three cases. If it doesn't, repeat steps 3-5)