Skip to content

Migrating your Saved Variables

The migration tools expect a variable name pattern that contains both “%uuid” and “%varname”. For example if you have variables like “s%uuid Money”, “s%uuid SpawnLocation”, etc. your variable name pattern would be “s%uuid %varname”

Additionally you will need a bucket name pattern, this needs to include “%uuid”. An example bucket name pattern could be data-%uuid, this will map variables like “s%uuid Money” to bucket variables with the name “Money” in the bucket “data-%uuid”.

This is non-destructive, it will not delete your saved variables.

Migrating variable data means going through existing variable data on your plot and mapping it to bucket variables. This may take a while if your plot has a lot of data.

To migrate variable data use /plot namespace migration varvalues <namespace alias> <bucket name pattern> <variable name pattern>

This will change saved variables in your code into bucket variables. This process isn’t entirely automated, variables with ambiguous names (meaning they have a % expression like %var instead of %uuid in them) will be listed in chat so you can fix them manually.

To migrate variables in your code use /plot namespace migration varitems <namespace alias> <bucket name pattern> <variable name pattern>

After applying both migrations you will need to introduce logic to load, periodically save, cleanup and unload buckets on your plot. See “Getting Started” for details.

For this example let’s say your variables are named like: “s%uuid Money”, “s%uuid Rank”, … and you want to migrate them to a namespace with the alias of “example-alias” and you want each players data in a bucket called “p-%uuid”. Your variable name pattern would be “s%uuid %varname”, your bucket name pattern would be “p-%uuid” and your alias would be “example-alias”.

To migrate your plot you would need to: Ideally clone your plot and whitelist the cloned version

Run /plot namespace migration varvalues example-alias p-%uuid s%uuid %varname

Then run /plot namespace migration varitems example-alias p-%uuid s%uuid %varname and deal with the ambiguous variable names that it cannot migrate automatically

And finally implement loading, periodic saving, cleanup and unloading as can be seen in “Getting Started”.

After this you should test your plot and make sure it works properly. Then you should be able to clone your plot back onto your main plot, set up the namespace alias and it should work!