Editing PostgreSQL/MediaWiki

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
PostgreSQL was initially used as our database for a number of reasons, from stability to compatibility with other apps to support for JSONB values.  
PostgreSQL is used as our database for a number of reasons, from stability to compatibility with other apps to support for JSONB values.  


It is clearly not the most popular choice of database for Mediawiki, but if the extensions you need (if you even used any) support PostgreSQL, it should be fine. Thus, we made some workarounds to support this unique use case, though eventually, we acquiesced and migrated to MariaDB. These mods are noted below.
However, it is clearly not the most popular choice of database for Mediawiki, so we do make some workarounds to support this unique use case. These mods are noted below.
 
== Installation ==
 
* Ubuntu 16.04 - https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
* CentOS 7 - https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7


=== PostgreSQL with UNIX Sockets ===
=== PostgreSQL with UNIX Sockets ===
Line 62: Line 57:
Use [[mediawikiwiki:Manual:DumpBackup.php|DumpBackup.php]] to create a full XML dump of all your wikipages and their edit history. SQL backups cannot be used in this transfer since, clearly PostgreSQL is incompatible with MySQL. However, XML dumps were designed to database independent with this in mind.
Use [[mediawikiwiki:Manual:DumpBackup.php|DumpBackup.php]] to create a full XML dump of all your wikipages and their edit history. SQL backups cannot be used in this transfer since, clearly PostgreSQL is incompatible with MySQL. However, XML dumps were designed to database independent with this in mind.


=== Make an Images backup ===
As for your images, if you leave them in images/ (or wherever you specified in {{ic|LocalSettings.php}}) after importing the XML backup in the next step, all the images should still work.
 
Note that all images have to be backed up and reimported for the database to recognize them. Just use [[mediawikiwiki:Manual:DumpUploads.php|DumpUploads.php]] to make the backup, and it will be imported in the next step.


=== Move to MySQL ===
=== Move to MySQL ===
Line 75: Line 68:
# But after the MySQL database is initialized, move only the MySQL specific settings from the downloaded {{ic|LocalSettings.php}} setup gives you, to overwrite the PostgreSQL settings in {{ic|LocalSettings.php.bak}}.
# But after the MySQL database is initialized, move only the MySQL specific settings from the downloaded {{ic|LocalSettings.php}} setup gives you, to overwrite the PostgreSQL settings in {{ic|LocalSettings.php.bak}}.
# Once the MySQL settings are moved in, rename {{ic|LocalSettings.php.bak}} to {{ic|LocalSettings.php}}.
# Once the MySQL settings are moved in, rename {{ic|LocalSettings.php.bak}} to {{ic|LocalSettings.php}}.
=== Restoring Wiki Data ===
# Now, restore your [[mediawikiwiki:Manual:Restoring_a_wiki_from_backup#From_an_XML_dump|XML Dump]], and make sure to regenerate RecentChanges as stated there.
# Now, restore your [[mediawikiwiki:Manual:Restoring_a_wiki_from_backup#From_an_XML_dump|XML Dump]], and make sure to regenerate RecentChanges as stated there.
# Next, restore your images by extracting the tarball created by [[mediawikiwiki:Manual:DumpUploads.php]], and then using [[mediawikiwiki:Manual:ImportImages.php]] (add the {{ic|--search-recursively}} argument to search under subdirectories).
# Finally, to make sure your extensions work, [[mediawikiwiki:Manual:Update.php#From_the_command_line|update your database.]]
# Finally, to make sure your extensions work, [[mediawikiwiki:Manual:Update.php#From_the_command_line|update your database.]]


Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Templates used on this page: