<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Database_transfer</id>
	<title>Database transfer - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Database_transfer"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Database_transfer&amp;action=history"/>
	<updated>2026-05-06T18:44:56Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Database_transfer&amp;diff=3283&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Database_transfer&amp;diff=3283&amp;oldid=prev"/>
		<updated>2024-10-18T06:37:32Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 06:37, 18 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Database_transfer&amp;diff=3282&amp;oldid=prev</id>
		<title>1&gt;Andrewnicols: Wrap command to improve readability</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Database_transfer&amp;diff=3282&amp;oldid=prev"/>
		<updated>2022-07-01T13:58:24Z</updated>

		<summary type="html">&lt;p&gt;Wrap command to improve readability&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Admin tools}}&lt;br /&gt;
&lt;br /&gt;
The database transfer tool allows an administrator to migrate their Moodle site from one database type to another, for example from MySQL to Postgres. &lt;br /&gt;
&lt;br /&gt;
The tool is currently classed as an experimental feature and may be found in &amp;#039;&amp;#039;Settings &amp;gt; Site administration &amp;gt; Development &amp;gt; Experimental &amp;gt; Database migration&amp;#039;&amp;#039;. There is also a command line script in &amp;#039;&amp;#039;admin/tool/dbtransfer/cli/migrate.php&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The dbtransfer tool uses the XMLDB schema definitions  from Moodle and installed plugins to retrieve the data from one database and transfer it another.&lt;br /&gt;
&lt;br /&gt;
Some troubles you may find when using this tool:&lt;br /&gt;
&lt;br /&gt;
* If there is any object in the current database (columns, tables,...) not included in the XMLDB schema or the other way around the dbtransfer won&amp;#039;t be executed until these objects are removed (this may happen if Moodle has been upgraded from earlier versions, if some plugin hasn&amp;#039;t been correctly uninstalled...).&lt;br /&gt;
* If there is some wrong encoded data in the current database the transfer will crash; in that case find and fix the troublemaking data and launch the dbtranfer tool again.&lt;br /&gt;
* If you are trying to migrate a big instance it will take a while, and there can be set some timeout (database, PHP, Apache) that can break the migration. In this instance you should use the CLI variant.&lt;br /&gt;
&lt;br /&gt;
==CLI Database Transfer==&lt;br /&gt;
&lt;br /&gt;
* put your site into [[Maintenance_mode]]&lt;br /&gt;
* disable [[Cron]] to avoid writing in database during the process&lt;br /&gt;
* execute the script (see below)&lt;br /&gt;
* update your config.php to use the new database configuration&lt;br /&gt;
* test everything that you are able to test&lt;br /&gt;
* disable Maintenance mode, and re-enable cron&lt;br /&gt;
&lt;br /&gt;
Depending on the size of your database, the process may take several hours.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example executions ===&lt;br /&gt;
&lt;br /&gt;
The following example executes the migration script to migrate to a postgres database:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo -u www-data /usr/bin/php /path/to/moodle/admin/tool/dbtransfer/cli/migrate.php \&lt;br /&gt;
    --dbtype=&amp;#039;pgsql&amp;#039; \&lt;br /&gt;
    --dbhost=&amp;#039;x.x.x.x&amp;#039; \&lt;br /&gt;
    --dbname=&amp;#039;moodleDbName&amp;#039; \&lt;br /&gt;
    --dbuser=&amp;#039;moodleUser&amp;#039; \&lt;br /&gt;
    --dbpass=&amp;#039;***&amp;#039; \&lt;br /&gt;
    --dbport=5432 \&lt;br /&gt;
    --prefix=&amp;#039;mdl_&amp;#039; \&lt;br /&gt;
    --dbsocket=&amp;#039;/var/run/postgresql&amp;#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, type &amp;lt;code&amp;gt;sudo -u www-data /usr/bin/php /path/to/moodle/admin/tool/dbtransfer/cli/migrate.php --help&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-34441 finish dbtransfer tool implementation&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=207413 Moving Moodle from Oracle to PostgreSQL (dbtransfer tool)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=206759 Where did dbtransfer.php go?]&lt;br /&gt;
&lt;br /&gt;
[[es:Transferencia de la BasedeDatos]]&lt;br /&gt;
[[de:Datenbank-Transfer]]&lt;br /&gt;
[[fr:Transfert de base de données]]&lt;/div&gt;</summary>
		<author><name>1&gt;Andrewnicols</name></author>
	</entry>
</feed>