Use the following to install or update conduit_migrate
;
cargo install --locked --git https://github.com/shadowjonathan/conduit_toolbox conduit_migrate
This'll place it in ~/.cargo/bin
, make sure you have this on your $PATH
, see
rustup documentation for more info.
You can choose a origin database format and a destination database format, the current ones are;
heed
sqlite
sled
rocks
(RocksDB)
To migrate a database, please do the following;
- Make sure your server is off, a conversion will be likely corrupted if you do it while it is running.
- Move the original database folder to a different place, a folder rename would do.
- You can technically convert databases in-place, but it is not recommended as it'll mix and match the files.
- Do not convert in-place when using the same origin and destination database formats, you will almost certainly corrupt your data
- Create a new folder. (With the original name would be preferred, as you then dont have to make any config edits)
- Do the following command, and replace the bits in
{}
curly brackets;conduit_migrate -s {old_directory} -f {old_database_format} -d {new_directory} -t {new_database_format}
old_directory
: the full path of the old directory (/mnt/data/conduit_db
)old_database_format
: the name of the old databse format (sqlite
,heed
, etc.)new_directory
: the full path of the new directorynew_database_format
: the name of the new database format (sqlite
,rocks
, etc.)- Don't put these inside the curly brackets, replace the whole part with curly brackets with the information.
- If a full path has a space, put it in quotation marks (
"/mnt/data/Matrix Server Stuff/conduit_db"
) - This command will show a bunch of numbers scrolling up rapidly, this is expected.
- If the scrolling stops, make sure you have a prompt again (
jonathan@jon:/mnt/data/conduit.dev/conduit_db$ _
) before going further, it might just be slow. - Make sure it has not ended with
Killed
orTerminated
, this means the process has failed.- Remove the new directory, recreate it, and try again. (Contact the conduit room if this keeps happening)
- If it failed and muttered something about "not enough space", you need to increase your free space before you can convert it.
- If the scrolling stops, make sure you have a prompt again (
- Move the
media
subfolder from the old folder to the new one. - Do not delete the old folder until you're sure that the new server works fine, only come back to deleting it about a month down the line (if everything went alright), or just back it up somewhere else.
Make sure the permissions on your old folder and the new folder are the same;
- Do
ls -l
whilecd
'd inside your old folder. - Note down the two names or numbers appearing before a long number in the file name;
jonathan@jon:/mnt/data/conduit.dev/conduit_db$ ls -l
total 368652
-rw-r--r-- 1 root 1002 377495552 Nov 27 15:20 conduit.db
^^^^ ^^^^
these
cd
into the new folder, then usechown root:1002 -R .
, replacingroot
and1002
here with the first and second name/number you saw inls -l
.
If you see multiple names or numbers, or this doesn't seem to work, please ask in the conduit room.