Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
owncloud-prm /
core /
doc /
admin /
maintenance /
Delete
Unzip
Name
Size
Permission
Date
Action
backup.html
13.81
KB
-rw-r--r--
2018-04-19 18:17
enable_maintenance.html
8.13
KB
-rw-r--r--
2018-04-19 18:17
index.html
12.35
KB
-rw-r--r--
2018-04-19 18:17
manual_upgrade.html
31.04
KB
-rw-r--r--
2018-04-19 18:17
manually-moving-data-folders.html
15.27
KB
-rw-r--r--
2018-04-19 18:17
migrating.html
21.35
KB
-rw-r--r--
2018-04-19 18:17
package_upgrade.html
15.22
KB
-rw-r--r--
2018-04-19 18:17
restore.html
11.71
KB
-rw-r--r--
2018-04-19 18:17
update.html
24.17
KB
-rw-r--r--
2018-04-19 18:17
upgrade.html
28.18
KB
-rw-r--r--
2018-04-19 18:17
Save
Rename
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Migrating to a Different Server — ownCloud 10.0.7 Server Administration Manual 10.0.7 documentation</title> <link rel="stylesheet" href="../_static/" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/main.min.css" type="text/css" /> <link rel="stylesheet" href="../_static/styles.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '10.0.7', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="../_static/js/jquery-fix.js"></script> <script type="text/javascript" src="../_static/bootstrap-3.1.0/js/bootstrap.min.js"></script> <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="How To Manually Move a Data Directory" href="manually-moving-data-folders.html" /> <link rel="prev" title="Restoring ownCloud" href="restore.html" /> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="theme-color" content="#1d2d44"> </head> <body> <div class="wrap container not-front"> <div class="content row"> <main class="main"> <div class="row page-content-header"> <div class="col-md-5 col-md-offset-7"> <form class="headersearch" style="margin-bottom:-3px;" action="../search.html" method="get"> <input type="text" value="" name="q" id="q" class="form-control" /> <button class="btn btn-default" type="submit" id="searchsubmit">Search</button> </form> </div> </div> <div class="row"> <div class="col-md-3"> <div class="sidebar"> <div class="menu-support-container"> <ul id="menu-support" class="menu"> <ul> <li><a href="../contents.html">Table of Contents</a></li> </ul> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release Notes</a></li> <li class="toctree-l1"><a class="reference internal" href="../whats_new_admin.html">What’s New in ownCloud 10.0.7</a></li> <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="../upgrading/index.html">Upgrading</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration/index.html">Configuration</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Maintenance</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="enable_maintenance.html">Maintenance Mode Configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="backup.html">Backing up ownCloud</a></li> <li class="toctree-l2"><a class="reference internal" href="upgrade.html">How to Upgrade Your ownCloud Server</a></li> <li class="toctree-l2"><a class="reference internal" href="package_upgrade.html">Upgrade ownCloud From Packages</a></li> <li class="toctree-l2"><a class="reference internal" href="update.html">Upgrading ownCloud with the Updater App</a></li> <li class="toctree-l2"><a class="reference internal" href="manual_upgrade.html">Manual ownCloud Upgrade</a></li> <li class="toctree-l2"><a class="reference internal" href="restore.html">Restoring ownCloud</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Migrating to a Different Server</a><ul> <li class="toctree-l3"><a class="reference internal" href="#how-to-migrate">How to Migrate</a></li> <li class="toctree-l3"><a class="reference internal" href="#managing-trusted-domains">Managing Trusted Domains</a></li> <li class="toctree-l3"><a class="reference internal" href="#example-migration">Example Migration</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="manually-moving-data-folders.html">How To Manually Move a Data Directory</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../issues/index.html">Issues and Troubleshooting</a></li> <li class="toctree-l1"><a class="reference internal" href="../enterprise/index.html">Enterprise Features</a></li> <li class="toctree-l1"><a class="reference internal" href="../appliance/index.html">The ownCloud X Appliance</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a></li> </ul> </ul> </div> </div> </div> <div class="col-md-9"> <div class="page-content"> <ul class="prevnext-title list-unstyled list-inline"> <li class="prev"> <a href="restore.html" title="Previous Chapter: Restoring ownCloud"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">« Restoring ownCloud</span> </a> </li> <li class="next"> <a href="manually-moving-data-folders.html" title="Next Chapter: How To Manually Move a Data Directory"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">How To Manual... »</span> </a> </li> </ul> <div class="section" id="migrating-to-a-different-server"> <h1>Migrating to a Different Server<a class="headerlink" href="#migrating-to-a-different-server" title="Permalink to this headline">¶</a></h1> <p>If the need arises, ownCloud can be migrated to a different server. A typical use case would be a hardware change or a migration from <a class="reference internal" href="../appliance/index.html"><span class="doc">the Enterprise appliance</span></a> to a physical server. All migrations have to be performed with ownCloud in maintenance mode. Online migration is supported by ownCloud only when implementing industry-standard clustering and high-availability solutions <strong>before</strong> ownCloud is installed for the first time.</p> <p>To start, let’s work through a potential use case. A configured ownCloud instance runs reliably on one machine, but for some reason the instance needs to be moved to a new machine. Depending on the size of the ownCloud instance the migration might take several hours.</p> <p>For the purpose of this use case, it is assumed that:</p> <ol class="arabic simple"> <li>The end users reach the ownCloud instance via a virtual hostname (such as a DNS <code class="docutils literal"><span class="pre">CNAME</span></code> record) which can be pointed at the new location.</li> <li>The authentication method (e.g., LDAP) remains the same after the migration.</li> </ol> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">During the migration, do not make any changes to the original system, except for putting it into maintenance mode. This ensures, should anything unforeseen happen, that you can go back to your existing installation and resume availability of your ownCloud installation while debugging the problem.</p> </div> <div class="section" id="how-to-migrate"> <h2>How to Migrate<a class="headerlink" href="#how-to-migrate" title="Permalink to this headline">¶</a></h2> <p>Firstly, set up the new machine with your desired Linux distribution. At this point you can either <a class="reference internal" href="../installation/source_installation.html"><span class="doc">install ownCloud manually</span></a> via the compressed archive, or <a class="reference internal" href="../installation/linux_installation.html"><span class="doc">with your Linux package manager</span></a>.</p> <p>Then, on the original machine turn on maintenance mode and then stop ownCloud. After waiting for 6 - 7 minutes for all sync clients to register that the server is in maintenance mode, ref:<cite>stop the web server <maintenance_commands_label></cite> that is serving ownCloud.</p> <p>After that, <a class="reference internal" href="backup.html#backup-database-label"><span class="std std-ref">create a database dump from the database</span></a>, copy it to the new machine, and <a class="reference internal" href="restore.html#restore-database-label"><span class="std std-ref">import it into the new database</span></a>.</p> <p>Then, copy only your data, configuration, and database files from your original ownCloud instance to the new machine (See <a class="reference internal" href="backup.html"><span class="doc">Backing up ownCloud</span></a> and <a class="reference internal" href="restore.html#restore-directories-label"><span class="std std-ref">Restore Directories</span></a>).</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">You must keep the <code class="docutils literal"><span class="pre">data/</span></code> directory’s original file path during the migration. However, <a class="reference internal" href="manually-moving-data-folders.html#datadir-move-label"><span class="std std-ref">you can change it</span></a> before you begin the migration, or after the migration’s completed.</p> </div> <p>The data files should keep their original timestamp otherwise the clients will re-download all the files after the migration. This step might take several hours, depending on your installation. This can be done on a number of sync clients, such as by using <code class="docutils literal"><span class="pre">rsync</span></code> with <code class="docutils literal"><span class="pre">-t</span></code> option</p> <p>With ownCloud still in maintenance mode and before changing the DNS <code class="docutils literal"><span class="pre">CNAME</span></code> record, start up the database and web server on the new machine. Then point your web browser to the migrated ownCloud instance and confirm that:</p> <ol class="arabic simple"> <li>You see the maintenance mode notice</li> <li>That a log file entry is written by both the web server and ownCloud</li> <li>That no error messages occur.</li> </ol> <p>If all of these things occur, then take ownCloud out of maintenance mode and repeat. After doing this, log in as an admin and confirm that ownCloud functions as normal.</p> <p>At this point, change the DNS <code class="docutils literal"><span class="pre">CNAME</span></code> entry to point your users to the new location. And with the <code class="docutils literal"><span class="pre">CNAME</span></code> entry updated, you now need to update the trusted domains.</p> </div> <div class="section" id="managing-trusted-domains"> <span id="trusted-domains-label"></span><h2>Managing Trusted Domains<a class="headerlink" href="#managing-trusted-domains" title="Permalink to this headline">¶</a></h2> <p>All URLs used to access your ownCloud server must be whitelisted in your <code class="docutils literal"><span class="pre">config.php</span></code> file, under the <code class="docutils literal"><span class="pre">trusted_domains</span></code> setting. Users are allowed to log into ownCloud only when they point their browsers to a URL that is listed in the <code class="docutils literal"><span class="pre">trusted_domains</span></code> setting.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">This setting is important when changing or moving to a new domain name. You may use IP addresses and domain names.</p> </div> <p>A typical configuration looks like this:</p> <div class="highlight-php"><div class="highlight"><pre><span></span><span class="x">'trusted_domains' => [</span> <span class="x"> 0 => 'localhost',</span> <span class="x"> 1 => 'server1.example.com',</span> <span class="x"> 2 => '192.168.1.50',</span> <span class="x">],</span> </pre></div> </div> <p>The loopback address, <code class="docutils literal"><span class="pre">127.0.0.1</span></code>, is automatically whitelisted, so as long as you have access to the physical server you can always log in. In the event that a load-balancer is in place, there will be no issues as long as it sends the correct <code class="docutils literal"><span class="pre">X-Forwarded-Host</span></code> header.</p> </div> <div class="section" id="example-migration"> <h2>Example Migration<a class="headerlink" href="#example-migration" title="Permalink to this headline">¶</a></h2> <p>Now, let’s step through an example migration. For this example to work, you will need the following on both the servers that you will use for the migration:</p> <ul class="simple"> <li>Ubuntu 16.04</li> <li>SSH with <code class="docutils literal"><span class="pre">PermitRootLogin</span></code> set to <code class="docutils literal"><span class="pre">yes</span></code></li> </ul> <div class="section" id="preparation"> <h3>Preparation<a class="headerlink" href="#preparation" title="Permalink to this headline">¶</a></h3> <p>Before you can perform a migration, you have to prepare. To do this, first make sure SSH is installed:</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">apt install ssh -y</span> </pre></div> </div> <p>Next, edit ssh-config and enable root ssh login.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">nano /etc/ssh/sshd_config</span> <span class="go">PermitRootLogin yes</span> </pre></div> </div> <p>And then restart SSH.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">service ssh restart</span> </pre></div> </div> <p>Lastly, install ownCloud on the new server.</p> </div> <div class="section" id="migration"> <h3>Migration<a class="headerlink" href="#migration" title="Permalink to this headline">¶</a></h3> <div class="section" id="enable-maintenance-mode"> <h4>Enable Maintenance Mode<a class="headerlink" href="#enable-maintenance-mode" title="Permalink to this headline">¶</a></h4> <p>The first step is to enable maintenance mode. To do that, use the following commands:</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">cd /var/www/owncloud/</span> <span class="go">sudo -u www-data php occ maintenance:mode --on</span> </pre></div> </div> <p>After that’s done, wait for 6-7 minutes and stop Apache:</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">service apache2 stop</span> </pre></div> </div> </div> <div class="section" id="transfer-the-database"> <h4>Transfer the Database<a class="headerlink" href="#transfer-the-database" title="Permalink to this headline">¶</a></h4> <p>Now, you have to transfer the database from the old server to the new one. To do that, first backup the database.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">cd /var/www/owncloud/</span> <span class="go">mysqldump --single-transaction -h localhost -u admin -ppassword owncloud > owncloud-dbbackup.bak</span> </pre></div> </div> <p>Then, export the database to the new server.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">rsync -Aaxt owncloud-dbbackup.bak root@new_server_address:/var/www/owncloud</span> </pre></div> </div> <p>With that completed, import the database on new server.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">mysql -h localhost -u admin -ppassword owncloud < owncloud-dbbackup.bak</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">You can find the values for the mysqldump command in your config.php, in your owncloud root directory. <code class="docutils literal"><span class="pre">[server]=</span> <span class="pre">dbhost,</span> <span class="pre">[username]=</span> <span class="pre">dbuser,</span> <span class="pre">[password]=</span> <span class="pre">dbpassword,</span> <span class="pre">and</span> <span class="pre">[db_name]=</span> <span class="pre">dbname</span></code>.</p> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last"><strong>For InnoDB tables only</strong> The –single-transaction flag will start a transaction before running. Rather than lock the entire database, this will let mysqldump read the database in the current state at the time of the transaction, making for a consistent data dump.</p> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last"><strong>For Mixed MyISAM / InnoDB tables</strong> Either dumping your MyISAM tables separately from InnoDB tables or use –lock-tables instead of –single-transaction to guarantee the database is in a consistent state when using mysqldump.</p> </div> </div> <div class="section" id="transfer-data-and-configure-the-new-server"> <h4>Transfer Data and Configure the New Server<a class="headerlink" href="#transfer-data-and-configure-the-new-server" title="Permalink to this headline">¶</a></h4> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">rsync -Aavxt config data root@new_server_address:/var/www/owncloud</span> </pre></div> </div> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">If you want to move your data directory to another location on the target server, it is advised to do this as a second step. Please see the data directory migration document <a class="reference internal" href="manually-moving-data-folders.html#datadir-move-label"><span class="std std-ref">How To Manually Move a Data Directory</span></a> for more details.</p> </div> </div> <div class="section" id="finish-the-migration"> <h4>Finish the Migration<a class="headerlink" href="#finish-the-migration" title="Permalink to this headline">¶</a></h4> <p>Now it’s time to finish the migration. To do that, on the new server, first verify that ownCloud is in maintenance mode.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">sudo -u www-data php occ maintenance:mode</span> </pre></div> </div> <p>Next, start up the database and web server on the new machine.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">service mysql start</span> <span class="go">service apache2 start</span> </pre></div> </div> <p>With that done, point your web browser to the migrated ownCloud instance, and confirm that you see the maintenance mode notice, and that no error messages occur. If both of these occur, take ownCloud out of maintenance mode.</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">sudo -u www-data php occ maintenance:mode --off</span> </pre></div> </div> <p>And finally, log in as admin and confirm normal function of ownCloud. If you have a domain name, and you want an SSL certificate, we recommend <a class="reference external" href="https://certbot.eff.org/">certbot</a>.</p> </div> <div class="section" id="reverse-the-changes-to-ssh-config"> <h4>Reverse the Changes to ssh-config<a class="headerlink" href="#reverse-the-changes-to-ssh-config" title="Permalink to this headline">¶</a></h4> <p>Now you need to reverse the change to ssh-config. Specifically, set <code class="docutils literal"><span class="pre">PermitRootLogin</span></code> to <code class="docutils literal"><span class="pre">no</span></code> and restart ssh. To do that, run the following command:</p> <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">service ssh restart</span> </pre></div> </div> </div> <div class="section" id="update-dns-and-trusted-domains"> <h4>Update DNS and Trusted Domains<a class="headerlink" href="#update-dns-and-trusted-domains" title="Permalink to this headline">¶</a></h4> <p>Finally, update the DNS’ <code class="docutils literal"><span class="pre">CNAME</span></code> entry to point to your new server. If you have not only migrated physically from server to server but have also changed your ownCloud server’s domain name, you also need to update the domain in <a class="reference internal" href="#trusted-domains-label"><span class="std std-ref">the Trusted Domain setting</span></a> in <code class="docutils literal"><span class="pre">config.php</span></code>, on the target server.</p> </div> </div> </div> </div> <ul class="prevnext-title list-unstyled list-inline"> <li class="prev"> <a href="restore.html" title="Previous Chapter: Restoring ownCloud"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">« Restoring ownCloud</span> </a> </li> <li class="next"> <a href="manually-moving-data-folders.html" title="Next Chapter: How To Manually Move a Data Directory"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">How To Manual... »</span> </a> </li> </ul> </div> </div> </div> </main> </div> </div> </body> </html>