Should be fairly easy:
0/ Make a backup
Extensions > NextOwnCloud > Backup button (on the Configuration tab).
1/ Initial MariaDB configuration:
Note: Beware of the XigmaNAS bugs noted here. The init script needs fixing as of XigmaNAS 11.2.0.4.6171.
Fixed in XigmaNAS 11.2.0.4.6177.
In
Services - MariaDB, configure things like this:
Home Directory: pick a location somewhere on your datavol, e.g.
Additional Parameter:
Code: Select all
transaction_isolation = READ-COMMITTED
binlog_format = ROW
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
query_cache_type = 1
[server]
query_cache_limit = 2M
query_cache_min_res_unit = 2k
query_cache_size = 64M
tmp_table_size= 64M
max_heap_table_size= 64M
[client]
default-character-set = utf8mb4
(NextCloud documentation reference:
https://docs.nextcloud.com/server/14/ad ... b-database)
Passphrase: Use some random long string.
Tick the "Enable" box and click Apply. You should have MariaDB running now.
Now, use SSH to log on to your NAS as root
Check the
Home Directory (e.g. /mnt/datavol/mysql), should have bunch of files and dirs there.
Check /var/db/mysql/my.cnf and see whether it has your "Additional Parameter" configured.
If everything looks good, run
Follow the prompts there, make sure to choose a good password for root, I'd suggest sticking with defaults for other steps.
2/ Creating a DB Nextcloud
The example steps below assume that:
- you have Nextcloud 14 installed
- the Nextcloud DB user is
nextclouduser
- the Nextcloud DB user's password is
t0ps3cret
- the database name will be
nextclouddb
- the lighttpd webserver is running as user
www (check Services > Webserver > Permission if unsure)
Obviously, you can (and should) adjust the username, password and db name as desired.
While still connected via SSH, run:
Supply your root password configured in step 1. Now, you are in MariaDB command prompt
Run the following commands (press Enter after each line):
Code: Select all
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 't0ps3cret';
CREATE DATABASE IF NOT EXISTS nextclouddb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON nextclouddb.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 't0ps3cret';
FLUSH privileges;
quit
(NextCloud documentation reference:
https://docs.nextcloud.com/server/14/ad ... ation.html)
Now you are back in FreeBSD shell.
3/ Converting Nextcloud from SQLite to MariaDB
While in shell, change your directory to where your Nextcloud install is (see Extensions - NextOwnCloud - Document Root if you don't know). E.g., /mnt/datavol/nextcloud/www
And run the db conversion:
Code: Select all
sudo -u www php occ db:convert-type --all-apps --password="t0ps3cret" mysql nextclouduser 127.0.0.1 nextclouddb
(NextCloud documentation reference:
https://docs.nextcloud.com/server/14/ad ... rsion.html)
If things go well, you should see something like this in output:
Code: Select all
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
The current PHP memory limit is below the recommended value of 512MB.
Creating schema in new database
The following tables will not be converted:
oc_privatedata
If you want to continue, press Y and Enter.
Code: Select all
Continue with the conversion (y/n)? [n] y
oc_accounts
6/6 [============================] 100%oc_activity
0 [>---------------------------]oc_activity_mq
0 [>---------------------------]oc_addressbookchanges
chunked query, 2 chunks
1332/1332 [============================] 100%oc_addressbooks
2/2 [============================] 100%oc_appconfig
241/241 [============================] 100%oc_authtoken
1/1 [============================] 100%oc_bruteforce_attempts
1/1 [============================] 100%oc_calendar_invitations
0 [>---------------------------]oc_calendar_resources
0 [>---------------------------]oc_calendar_rooms
0 [>---------------------------]oc_calendarchanges
0 [>---------------------------]oc_calendarobjects
0 [>---------------------------]oc_calendarobjects_props
0 [>---------------------------]oc_calendars
1/1 [============================] 100%oc_calendarsubscriptions
0 [>---------------------------]oc_cards
6/6 [============================] 100%oc_cards_properties
25/25 [============================] 100%oc_comments
0 [>---------------------------]oc_comments_read_markers
0 [>---------------------------]oc_credentials
0 [>---------------------------]oc_dav_shares
0 [>---------------------------]oc_directlink
0 [>---------------------------]oc_federated_reshares
0 [>---------------------------]oc_file_locks
0 [>---------------------------]oc_filecache
204/204 [============================] 100%oc_files_trash
0 [>---------------------------]oc_flow_checks
0 [>---------------------------]oc_flow_operations
0 [>---------------------------]oc_group_admin
0 [>---------------------------]oc_group_folders
0 [>---------------------------]oc_group_folders_groups
0 [>---------------------------]oc_group_user
1/1 [============================] 100%oc_groups
1/1 [============================] 100%oc_jobs
26/26 [============================] 100%oc_ldap_group_mapping
0 [>---------------------------]oc_ldap_group_members
0 [>---------------------------]oc_ldap_user_mapping
5/5 [============================] 100%oc_migrations
Skipping migrations table because it was already filled by running the migrations
oc_mimetypes
32/32 [============================] 100%oc_mounts
1/1 [============================] 100%oc_notifications
0 [>---------------------------]oc_notifications_pushtokens
0 [>---------------------------]oc_oauth2_access_tokens
0 [>---------------------------]oc_oauth2_clients
0 [>---------------------------]oc_preferences
68/68 [============================] 100%oc_properties
0 [>---------------------------]oc_schedulingobjects
0 [>---------------------------]oc_share
0 [>---------------------------]oc_share_external
0 [>---------------------------]oc_storages
7/7 [============================] 100%oc_systemtag
0 [>---------------------------]oc_systemtag_group
0 [>---------------------------]oc_systemtag_object_mapping
0 [>---------------------------]oc_trusted_servers
0 [>---------------------------]oc_twofactor_backupcodes
0 [>---------------------------]oc_twofactor_providers
1/1 [============================] 100%oc_twofactor_totp_secrets
0 [>---------------------------]oc_users
1/1 [============================] 100%oc_users_external
0 [>---------------------------]oc_vcategory
0 [>---------------------------]oc_vcategory_to_object
0 [>---------------------------]oc_whats_new
0 [>---------------------------]
Two more to go, first make sure the DB is actually using the utf8mb4 encoding (the conversion routine does not seem to do this), and finally check things (and fix up if needed):
Code: Select all
sudo -u www php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www php occ maintenance:repair
(Nextcloud documentation reference:
https://docs.nextcloud.com/server/14/ad ... te-support)
4. Finished.
Everything should be done and ready now, and you should be able to log on to your Nextcloud instance as before.
