mirror of
https://github.com/nextcloud/documentation.git
synced 2025-10-26 11:18:02 +00:00
Merge pull request #414 from Tronde/stable9
Backported restore warning from master.
This commit is contained in:
commit
7c5a48af81
@ -8,18 +8,18 @@ restore:
|
||||
#. The configuration directory
|
||||
#. The data directory
|
||||
#. The database
|
||||
# The theme directory
|
||||
#. The theme directory
|
||||
|
||||
.. note:: You must have both the database and data directory. You cannot
|
||||
.. note:: You must have both the database and data directory. You cannot
|
||||
complete restoration unless you have both of these.
|
||||
|
||||
When you have completed your restoration, see the ``Setting Strong Directory
|
||||
When you have completed your restoration, see the ``Setting Strong Directory
|
||||
Permissions`` section of :doc:`../installation/installation_wizard`.
|
||||
|
||||
Restore Folders
|
||||
---------------
|
||||
|
||||
.. note:: This guide assumes that your previous backup is called
|
||||
.. note:: This guide assumes that your previous backup is called
|
||||
"nextcloud-dirbkp"
|
||||
|
||||
Simply copy your configuration and data folder (or even your whole Nextcloud
|
||||
@ -30,7 +30,39 @@ install and data folder) to your Nextcloud environment. You could use this comma
|
||||
Restore Database
|
||||
----------------
|
||||
|
||||
.. note:: This guide assumes that your previous backup is called
|
||||
Clean Database Before Restoring
|
||||
===============================
|
||||
|
||||
.. warning:: Before restoring a backup you need to make sure to delete all existing database tables.
|
||||
|
||||
The easiest way to do this is to drop and recreate the database.
|
||||
SQLite does this automatically.
|
||||
|
||||
MySQL
|
||||
^^^^^
|
||||
|
||||
MySQL is the recommended database engine. To restore MySQL::
|
||||
|
||||
mysql -h [server] -u [username] -p[password] -e "DROP DATABASE nextcloud"
|
||||
mysql -h [server] -u [username] -p[password] -e "CREATE DATABASE nextcloud"
|
||||
|
||||
If you use UTF8 with multibyte support (e.g. for emoijs in filenames), use::
|
||||
|
||||
mysql -h [server] -u [username] -p[password] -e "DROP DATABASE nextcloud"
|
||||
mysql -h [server] -u [username] -p[password] -e "CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
|
||||
|
||||
|
||||
PostgreSQL
|
||||
^^^^^^^^^^
|
||||
::
|
||||
|
||||
PGPASSWORD="password" psql -h [server] -U [username] -d nextcloud -c "DROP DATABASE \"nextcloud\";"
|
||||
PGPASSWORD="password" psql -h [server] -U [username] -d nextcloud -c "CREATE DATABASE \"nextcloud\";"
|
||||
|
||||
Restoring
|
||||
=========
|
||||
|
||||
.. note:: This guide assumes that your previous backup is called
|
||||
"nextcloud-sqlbkp.bak"
|
||||
|
||||
MySQL
|
||||
@ -44,8 +76,8 @@ SQLite
|
||||
^^^^^^
|
||||
::
|
||||
|
||||
rm data/nextcloud.db
|
||||
sqlite3 data/nextcloud.db < nextcloud-sqlbkp.bak
|
||||
rm data/owncloud.db
|
||||
sqlite3 data/owncloud.db < nextcloud-sqlbkp.bak
|
||||
|
||||
PostgreSQL
|
||||
^^^^^^^^^^
|
||||
|
||||
Loading…
Reference in New Issue
Block a user