Opened 3 years ago
Closed 3 years ago
#3 closed task (fixed)
Migrate ownCloud from GreenQloud
| Reported by: | chris | Owned by: | chris |
|---|---|---|---|
| Priority: | major | Milestone: | Install and configure crin1 |
| Component: | owncloud | Version: | |
| Keywords: | Cc: | jenny, gillian | |
| Estimated Number of Hours: | 2.5 | Add Hours to Ticket: | 0 |
| Billable?: | yes | Total Hours: | 2.55 |
Description
Migrate the ownCloud site from the GreenQloud server to crin1.crin.org.
Change History (7)
comment:1 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 1.6
- Total Hours set to 1.6
comment:2 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 0.5
- Total Hours changed from 1.6 to 2.1
There is a document Migrating to a Different Server which only differs in as much as it advises that the site should first be put into "maintenance mode".
The site can be put into "maintenance mode" using the occ comand line interface, see Using the occ Command.
So trying that, on the live server:
sudo -i su - cloud -s /bin/bash php occ maintenance:mode --on Maintenance mode enabled
Check the status at https://cloud.crin.org/ then run the data sync command on Crin1:
sudo -i bash bin/owncloud-sync
Now the site at https://cloud.crin1.crin.org/ works (no idea why it wasn't yesterday) but isn't in "maintenance mode"...
Migration script updated to add these steps:
#!/bin/bash # enable maintainance mode on remote server ssh web2 "sudo -u cloud php /var/www/owncloud/occ maintenance:mode --on" rsync -av web2:/var/www/owncloud/apps/ /var/www/owncloud/apps/ #rsync -av web2:/var/www/owncloud/config/ /var/www/owncloud/config/ rsync -av web2:/var/www/owncloud/data/ /var/www/owncloud/data/ chown -R owncloud:owncloud /var/www/owncloud/apps/ chown -R owncloud:owncloud /var/www/owncloud/config/ chown -R owncloud:owncloud /var/www/owncloud/data/ ssh web2 "mysqldump -uowncloud -pXXX owncloud > /root/owncloud.sql" scp web2:owncloud.sql /root/ cat /root/owncloud.sql | mysql owncloud # disable maintainance mode on remote server ssh web2 "sudo -u cloud php /var/www/owncloud/occ maintenance:mode --on"
Maintainance mode on the live server was switched off.
The admin interface displays:
Configuration Checks
No problems found
So I think this application is now ready to be migrated.
A start has been made on documenting ownCloud at wiki:OwnCloud.
comment:3 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 0.05
- Estimated Number of Hours changed from 0 to 2.5
- Total Hours changed from 2.1 to 2.15
2h 6m have been spent on this ticket so far, it's now ready for testing at https://cloud.crin1.crin.org/ and if everything is good it can be quickly updated prior to a DNS switch using the /root/bin/owncloud-sync script on Crin1, I'm adding a total estimated time to this ticket of 2.5 hours.
comment:4 Changed 3 years ago by jonas
I tried ownCloud and it opens and displays all the files. However, opening files is very slow. Could have to do with my connection as well though..
comment:5 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 0.25
- Total Hours changed from 2.15 to 2.4
Doing a final sync before the DNS update on Crin1:
sudo -i bash bin/owncloud-sync
Update ownCloud and other Debian packages:
a-up su - owncloud -s /bin/bash php console.php upgrade Turned on maintenance mode Checked database schema update Checked database schema update for apps Updated database Disabled 3rd-party app: documents Turned off maintenance mode Update successful
Tried to update the DNS but I don't have the right username and password, so will come back to this later.
comment:6 Changed 3 years ago by chris
- Cc jenny gillian added; jonas removed
Added Jenny and Gillian as CCs for this ticket.
comment:7 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 0.15
- Resolution set to fixed
- Status changed from new to closed
- Total Hours changed from 2.4 to 2.55
I have updated the dns for ownCloud so in a while accessing https://cloud.crin.org/ should result in people getting the Crin1 server. The 1984.is DNS have updated:
dig @NS0.1984.IS cloud.crin.org +short 93.95.228.179
The site on the GreenCloud server is in maintenance mode, so this ticket is now being closed, if there are any problems new tickets can be opened.

Following the install instructions:
So /etc/apt/sources.list.d/owncloud.list was created containing:
And the GPG key was installed:
These ownCloud packges are now available:
The packages installed on web2.crin.org are:
So these were installed:
aptitude install owncloud owncloud-3rdparty owncloud-app-activity owncloud-app-external owncloud-app-files owncloud-app-files-encryption owncloud-app-files-external owncloud-app-files-locking owncloud-app-files-pdfviewer owncloud-app-files-sharing owncloud-app-files-texteditor owncloud-app-files-trashbin owncloud-app-files-versions owncloud-app-files-videoviewer owncloud-app-firstrunwizard owncloud-app-gallery owncloud-app-provisioning-api owncloud-app-templateeditor owncloud-app-user-external owncloud-app-user-ldap owncloud-app-user-webdavauth owncloud-config-apache owncloud-server The following NEW packages will be installed: curl{a} libmcrypt4{a} libpq5{a} mysql-server{a} owncloud owncloud-3rdparty owncloud-app-activity owncloud-app-external owncloud-app-files owncloud-app-files-encryption owncloud-app-files-external owncloud-app-files-locking owncloud-app-files-pdfviewer owncloud-app-files-sharing owncloud-app-files-texteditor owncloud-app-files-trashbin owncloud-app-files-versions owncloud-app-files-videoviewer owncloud-app-firstrunwizard owncloud-app-gallery owncloud-app-provisioning-api owncloud-app-templateeditor owncloud-app-user-external owncloud-app-user-ldap owncloud-app-user-webdavauth owncloud-config-apache owncloud-server php5{a} php5-mcrypt{a} php5-pgsql{a} php5-sqlite{a} 0 packages upgraded, 31 newly installed, 0 to remove and 0 not upgraded. Need to get 17.8 MB of archives. After unpacking 73.1 MB will be used. Do you want to continue? [Y/n/?] yThe install has enabled /etc/apache/conf-available/owncloud.conf via the /etc/apache/conf-enabled/owncloud.conf symlink, we don't want /owncloud to work for all domains on the server so that symlink was deleted, the file contains:
Alias /owncloud "/var/www/owncloud/" <Directory "/var/www/owncloud"> Options +FollowSymLinks AllowOverride All </Directory>An apache config was created at /etc/apache2/sites-available/owncloud.conf containing:
<VirtualHost *:80> <IfModule mpm_itk_module> AssignUserID owncloud owncloud MaxClientsVHost 60 </IfModule> ServerName cloud.crin.org ServerAlias www.cloud.crin.org ServerAlias cloud.crin1.crin.org <If "%{HTTP_HOST} == 'cloud.crin.org'"> Redirect / https://cloud.crin.org/ </If> <If "%{HTTP_HOST} == 'www.cloud.crin.org'"> Redirect / https://cloud.crin.org/ </If> <If "%{HTTP_HOST} == 'cloud.crin1.crin.org'"> Redirect / https://cloud.crin1.crin.org/ </If> </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> <IfModule mpm_itk_module> AssignUserID owncloud owncloud MaxClientsVHost 60 </IfModule> ServerAdmin chris@webarchitects.co.uk ServerName cloud.crin.org ServerAlias www.cloud.crin.org ServerAlias cloud.crin1.crin.org SSLEngine on SSLCertificateFile /etc/ssl/gandi/cloud.crt.pem SSLCertificateKeyFile /etc/ssl/gandi/cloud.key.pem SSLCACertificateFile /etc/ssl/gandi/root.pem SetEnv TMPDIR /var/www/owncloud/tmp DocumentRoot /var/www/owncloud <Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /var/www/owncloud> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <IfModule mod_php5.c> php_admin_value open_basedir /var/www/owncloud php_admin_value upload_tmp_dir /var/www/owncloud/tmp php_admin_value session.save_path /var/www/owncloud/tmp php_admin_value file_uploads 1 </IfModule> ErrorLog ${APACHE_LOG_DIR}/owncloud.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/owncloud.ssl_access.log combined <IfModule headers_module> # Use HTTP Strict Transport Security to force client to use secure connections only #Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" Header always set Strict-Transport-Security "max-age=31536000" # mitigate TIME attack Header always append X-Frame-Options "sameorigin" </IfModule> <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule>And then this was symlinked and tested:
So the owncloud user was created:
Creat a TMPDIR:
Setup vim for the owncloud user and enable history:
So now sync the data and create a script for future data syncs that will be needed before the DNS update.
First create a MySQL database for the site:
Initial sync of files:
Update the /var/www/owncloud/config/config.php with the correct MySQL details.
Create a script for future sycncs, /root/bin/owncloud-sync:
And run it.
Check for database updates:
So that was added to the Apache config for the site and also to /etc/php5/cli/php.ini, try again:
Restart Apache and test at https://cloud.crin1.crin.org/
And the login doesn't work, no error, it just doesn't log one in.
This variables was changed in /var/www/owncloud/config/config.php just in case that helped:
But it don't help.
I think I need to look up documentation on migrating sites / and or how to change the admin password to solve this.