<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://mineplugin.org/index.php?action=history&amp;feed=atom&amp;title=Magic%2FPlayer_Data_Storage</id>
	<title>Magic/Player Data Storage - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://mineplugin.org/index.php?action=history&amp;feed=atom&amp;title=Magic%2FPlayer_Data_Storage"/>
	<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Player_Data_Storage&amp;action=history"/>
	<updated>2026-05-07T22:53:22Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mineplugin.org/index.php?title=Magic/Player_Data_Storage&amp;diff=15240&amp;oldid=prev</id>
		<title>炫宙菌：​创建页面，内容为“By default, Magic will store player data in plugins/Magic/data/players.  Player data contains the classes and spells players have unlocked, SP earned, various stats,…”</title>
		<link rel="alternate" type="text/html" href="https://mineplugin.org/index.php?title=Magic/Player_Data_Storage&amp;diff=15240&amp;oldid=prev"/>
		<updated>2021-06-27T15:39:39Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“By default, Magic will store player data in plugins/Magic/data/players.  Player data contains the classes and spells players have unlocked, SP earned, various stats,…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;By default, Magic will store player data in plugins/Magic/data/players.&lt;br /&gt;
&lt;br /&gt;
Player data contains the classes and spells players have unlocked, SP earned, various stats, stored wands, undo queues (for engineering magic) and a host of other information. It is important to keep these backed up and safe!&lt;br /&gt;
&lt;br /&gt;
If you would prefer to store your player data in a database, Magic will easily let you do this!&lt;br /&gt;
&lt;br /&gt;
Magic can also migrate existing player data from the flatfile format, or from any store type to any other.&lt;br /&gt;
&lt;br /&gt;
See the [https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/defaults/config/data_storage.yml default configs] here for examples.&lt;br /&gt;
&lt;br /&gt;
== Using the editor ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;/mconfig editor config player_data_store&amp;lt;/code&amp;gt; to edit the player data store configs, and add the following:&lt;br /&gt;
&lt;br /&gt;
== SQLite ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;player_data_store:&lt;br /&gt;
  class: SQLite&lt;br /&gt;
  database: players&amp;lt;/pre&amp;gt;&lt;br /&gt;
== MySQL ==&lt;br /&gt;
&lt;br /&gt;
MySQL can also be used, this can be useful if you have servers on a Bungee (or other proxy) network and you want their magic data to stay in sync across all servers. Note you will probably also want to set up inventory syncing, which is not something Magic will do for you.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional, though you will hopefully need to at least specify user and password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;player_data_store:&lt;br /&gt;
  class: MySQL&lt;br /&gt;
  database: magic&lt;br /&gt;
  host: yourdatabaseserver&lt;br /&gt;
  port: 3306&lt;br /&gt;
  user: minecraft&lt;br /&gt;
  password: somethingsecure&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Postgres ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;player_data_store:&lt;br /&gt;
  class: PostresSQL&lt;br /&gt;
  database: magic&lt;br /&gt;
  host: localhost&lt;br /&gt;
  port: 3306&lt;br /&gt;
  user: minecraft&lt;br /&gt;
  password: somethingsecure&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Migrating Existing Player Data =&lt;br /&gt;
&lt;br /&gt;
If you already have player data (this happens as soon as players log in with the plugin installed) and you want to switch data storage, you can do so while easily migrating your data.&lt;br /&gt;
&lt;br /&gt;
It is &amp;#039;&amp;#039;recommended&amp;#039;&amp;#039; to turn on a server whitelist during this process, though it may not be necessary.&lt;br /&gt;
&lt;br /&gt;
It is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;strongly&amp;#039;&amp;#039;&amp;#039; recommended&amp;#039;&amp;#039; to backup your existing player data before migrating!&lt;br /&gt;
&lt;br /&gt;
In config.yml (or the editor) you would change your existing &amp;lt;code&amp;gt;player_data_store&amp;lt;/code&amp;gt; block to &amp;lt;code&amp;gt;migrate_data_store&amp;lt;/code&amp;gt;, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;&amp;quot;&amp;gt;migrate_data_store:&lt;br /&gt;
  class: Yaml&lt;br /&gt;
  folder: data/players&amp;lt;/pre&amp;gt;&lt;br /&gt;
This block has the configuration of where your player data currently resides. The &amp;lt;code&amp;gt;player_data_store&amp;lt;/code&amp;gt; block should contain your new player data configuration.&lt;br /&gt;
&lt;br /&gt;
Once this is set up, you should run the &amp;lt;code&amp;gt;/magic migrate&amp;lt;/code&amp;gt; command to push the migration process through (or it will happen at next boot).&lt;br /&gt;
&lt;br /&gt;
After migration is complete you can remove the &amp;lt;code&amp;gt;migrate_data_store&amp;lt;/code&amp;gt; config, using the same editor command as before.&lt;/div&gt;</summary>
		<author><name>炫宙菌</name></author>
	</entry>
</feed>