Setup:Installation Guide/Advanced/Backup: Difference between revisions

No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Manual backup ===


===<span class="mw-headline" id="Backup_der_Datenbank" style="box-sizing: inherit;">Backup of the database</span>===
==== Backup of the database ====
To back up your database, use the native program "mysqldump" of MySQL/MariaDB: Open a console, switch to the directory <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><installpath-bluespice></code> and backup your database with the following command:
To back up your database, use the native program <code>mysqldump</code> of MySQL/MariaDB: Open a console, switch to the directory <code><installpath-bluespice></code> and backup your database with the following command:
  mysqldump -u <username> -p --lock-tables <database> > database.sql
  mysqldump -u <username> -p --lock-tables <database> > database.sql
For <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><username></code> <span>,</span> use the administrative database user, and for <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><database></code> <span>, use the database of your</span> MediaWiki/BlueSpice installation.
For <code><username></code> , use the administrative database user, and for <code><database></code> , use the database of your MediaWiki/BlueSpice installation.  
{{Messagebox|boxtype=Hinweis|Note text=In Windows, make sure that your environment variables are set correctly, so that you can access the command "mysqldump".}}
===<span class="mw-headline" id="Backup_des_Filesystems" style="box-sizing: inherit;">Backup of the file system</span>===
Back up the complete directory <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><installpath-bluespice></code>, which now also includes the database image, to a different location on your server.


'''For security reasons, immediately delete the file<code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><installpath-bluespice>/database.sql</code>, since it can be accessed from the browser.'''
{{Textbox|boxtype=important|header=|text=On Windows, make sure that your environment variables are set correctly, so that you can access the command <code>mysqldump</code>.|icon=yes}}
 
==== Backup of the file system ====
Back up the complete directory <code><installpath-bluespice></code>, which now also includes the database image, to a different location on your server.
 
'''For security reasons, immediately delete the file<code><installpath-bluespice>/database.sql</code>, since it can be accessed from the browser.'''
 
=== Using the <code>mediawiki-adm</code> tool ===
To eas backup and restore one can also use the <code>mediawiki-adm</code> tool. It can be downloaded here: https://github.com/hallowelt/misc-mediawiki-adm
 
 
'''Example usage:'''
mediawiki-adm wiki-backup \
     --mediawiki-root <installpath-bluespice> \
     --dest /mnt/backup/
The tool will leave out all unnecessary data (like temporary files and cache database tables)and produce much smaller backup files that the manual method described above. It also allows to create versioned backups.

Latest revision as of 08:31, 7 March 2024

Manual backup

Backup of the database

To back up your database, use the native program mysqldump of MySQL/MariaDB: Open a console, switch to the directory <installpath-bluespice> and backup your database with the following command:

mysqldump -u <username> -p --lock-tables <database> > database.sql

For <username> , use the administrative database user, and for <database> , use the database of your MediaWiki/BlueSpice installation.

On Windows, make sure that your environment variables are set correctly, so that you can access the command mysqldump.


Backup of the file system

Back up the complete directory <installpath-bluespice>, which now also includes the database image, to a different location on your server.

For security reasons, immediately delete the file<installpath-bluespice>/database.sql, since it can be accessed from the browser.

Using the mediawiki-adm tool

To eas backup and restore one can also use the mediawiki-adm tool. It can be downloaded here: https://github.com/hallowelt/misc-mediawiki-adm


Example usage:

mediawiki-adm wiki-backup \
    --mediawiki-root <installpath-bluespice> \
    --dest /mnt/backup/

The tool will leave out all unnecessary data (like temporary files and cache database tables)and produce much smaller backup files that the manual method described above. It also allows to create versioned backups.



To submit feedback about this documentation, visit our community forum.