<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Transition Technology: Ticket #896: Chive access to TN Drupal DB</title>
    <link>http://localhost:8080/trac/ticket/896</link>
    <description>&lt;p&gt;
Ade would like to give the developers of the new Transition Network  &lt;a class="wiki" href="http://localhost:8080/trac/wiki/WordPress"&gt;WordPress&lt;/a&gt; site access to the live database via Chive.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>Transition Technology</title>
      <url>/trac/chrome/site/TransitionNetwork-Logo-Web-Small.jpg</url>
      <link>http://localhost:8080/trac/ticket/896</link>
    </image>
    <generator>Trac 0.12.5</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 18 Jan 2016 18:21:38 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:1</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.45&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.45&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
&lt;strong&gt;Paul: do you know which database on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer"&gt;PuffinServer&lt;/a&gt; is the live TN Drupal database?&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Creating a MySQL database user with read only access, first track down the &lt;tt&gt;settings.php&lt;/tt&gt; files to find the database name, there are 150 &lt;tt&gt;settings.php&lt;/tt&gt; files on the server:
&lt;/p&gt;
&lt;pre class="wiki"&gt;locate settings.php | wc -l
150
&lt;/pre&gt;&lt;p&gt;
The files looks to be &lt;tt&gt;/data/disk/tn/platforms/transitionnetwork.org/sites/default/default.settings.php&lt;/tt&gt; however that only contains an example:
&lt;/p&gt;
&lt;pre class="wiki"&gt;$db_url = 'mysql://username:password@localhost/databasename';
&lt;/pre&gt;&lt;p&gt;
Looking in &lt;tt&gt;/data/disk/tn/aegir/distro/019/sites/tn.puffin.webarch.net/settings.php&lt;/tt&gt; we have:
&lt;/p&gt;
&lt;pre class="wiki"&gt;if (isset($_SERVER['db_name'])) {
  /**
   * The database credentials are stored in the Apache or Nginx vhost config
   * of the associated site with SetEnv (fastcgi_param in Nginx) parameters.
   * They are called here with $_SERVER environment variables to
   * prevent sensitive data from leaking to site administrators
   * with PHP access, that potentially might be of other sites in
   * Drupal's multisite set-up.
   * This is a security measure implemented by the Aegir project.
   */
  $databases['default']['default'] = array(
    'driver' =&amp;gt; $_SERVER['db_type'],
    'database' =&amp;gt; $_SERVER['db_name'],
    'username' =&amp;gt; $_SERVER['db_user'],
    'password' =&amp;gt; $_SERVER['db_passwd'],
    'host' =&amp;gt; $_SERVER['db_host'],
    /* Drupal interprets $databases['db_port'] as a string, whereas Drush sees
     * it as an integer. To maintain consistency, we cast it to a string. This
     * should probably be fixed in Drush.
     */
    'port' =&amp;gt; (string) $_SERVER['db_port'],
  );
  $db_url['default'] = $_SERVER['db_type'] . '://' . $_SERVER['db_user'] . ':' . $_SERVER['db_passwd'] . '@' . $_SERVER['db_host'] . ':' . $_SERVER['db_port'] . '/' . $_SERVER['db_name'];
}
&lt;/pre&gt;&lt;p&gt;
So if this is the right &lt;tt&gt;settings.php&lt;/tt&gt; we need to track down the correct Nginx conf file (there are dozens... there is no ends of obfuscation that thanks to BOA...).
&lt;/p&gt;
&lt;p&gt;
The main config file &lt;tt&gt;/etc/nginx/nginx.conf&lt;/tt&gt; includes &lt;tt&gt;/etc/nginx/conf.d/*.conf&lt;/tt&gt; which in turn includes &lt;tt&gt;/var/aegir/config/server_master/nginx/vhost.d/*&lt;/tt&gt; and the &lt;tt&gt;/var/aegir/config/server_master/nginx/vhost.d/chive.master.puffin.webarch.net&lt;/tt&gt; file contains the Chive servername, &lt;tt&gt;chive.master.puffin.webarch.net&lt;/tt&gt; however this is a 403: &lt;a class="ext-link" href="https://chive.master.puffin.webarch.net/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://chive.master.puffin.webarch.net/&lt;/a&gt; so some work would be needed to get Chive working on the server it seems, still no luck finding the Ngnix config file for the live site...
&lt;/p&gt;
&lt;p&gt;
Looking at the databases on the server we have:
&lt;/p&gt;
&lt;pre class="wiki"&gt;MariaDB [(none)]&amp;gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bookerstage20150   |
| bookerstage201_2   |
| bookerstagesamtr   |
| masterpuffinwe_0   |
| mysql              |
| newstransitionne   |
| performance_schema |
| teststgtransit_0   |
| tnpuffinwebarchn   |
| transitionnetw_0   |
+--------------------+
11 rows in set (0.00 sec)
&lt;/pre&gt;&lt;p&gt;
It might be easier and a lot quicker to ask Paul which is the live database and then dump it, copy it to &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt; and grant access to it there vi phpMyAdmin, we could also drop the table/row with the passwords in it for added safety, adding Paul to this ticket and bold line at the top of this ticket.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 18 Jan 2016 18:26:41 GMT</pubDate>
      <title>cc changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:2</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;paul&lt;/em&gt; added
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Paul, which of these database on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer"&gt;PuffinServer&lt;/a&gt; is the &lt;a class="ext-link" href="https://www.transitionnetwork.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.transitionnetwork.org/&lt;/a&gt; live database?
&lt;/p&gt;
&lt;pre class="wiki"&gt;MariaDB [(none)]&amp;gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bookerstage20150   |
| bookerstage201_2   |
| bookerstagesamtr   |
| masterpuffinwe_0   |
| mysql              |
| newstransitionne   |
| performance_schema |
| teststgtransit_0   |
| tnpuffinwebarchn   |
| transitionnetw_0   |
+--------------------+
11 rows in set (0.00 sec)
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 18 Jan 2016 19:18:27 GMT</pubDate>
      <title>hours, status, totalhours changed; resolution set</title>
      <link>http://localhost:8080/trac/ticket/896#comment:3</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.35&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.45&lt;/em&gt; to &lt;em&gt;0.8&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
&lt;strong&gt;Paul ignore the above, I worked out a work-around&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Another way to work out which is the live database -- it is probably the biggest one, so looking at the dumps from last night:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/backups/mysql/sqldump/
ls -lah | grep "Jan 18"
-rw------- 1 root root 229M Jan 18 01:00 bookerstage20150.sql
-rw------- 1 root root 3.0M Jan 18 01:00 bookerstage201_2.sql
-rw------- 1 root root 224M Jan 18 01:01 bookerstagesamtr.sql
-rw------- 1 root root  58M Jan 18 01:00 information_schema.sql
-rw------- 1 root root 5.0M Jan 18 01:01 masterpuffinwe_0.sql
-rw------- 1 root root 513K Jan 18 01:01 mysql.sql
-rw------- 1 root root 4.2M Jan 18 01:01 newstransitionne.sql
-rw------- 1 root root  17K Jan 18 01:01 performance_schema.sql
-rw------- 1 root root 310K Jan 18 01:01 teststgtransit_0.sql
-rw------- 1 root root 5.0M Jan 18 01:01 tnpuffinwebarchn.sql
-rw------- 1 root root 447M Jan 18 01:02 transitionnetw_0.sql
&lt;/pre&gt;&lt;p&gt;
It looks like &lt;tt&gt;transitionnetw_0.sql&lt;/tt&gt; is the one, so:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cp  transitionnetw_0.sql /home/chris/
chown chris:chris /home/chris/transitionnetw_0.sql
&lt;/pre&gt;&lt;p&gt;
Then reconnect with &lt;tt&gt;ssh -A&lt;/tt&gt; and:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp transitionnetw_0.sql parrot.webarch.net:
&lt;/pre&gt;&lt;p&gt;
Then on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql&amp;gt; CREATE DATABASE tnro;
Query OK, 1 row affected (0.00 sec)
mysql&amp;gt; CREATE USER 'tnro'@'localhost' IDENTIFIED BY 'XXXX';
Query OK, 0 rows affected (0.07 sec)
mysql&amp;gt; GRANT SELECT ON tnro.* TO 'tnro'@'localhost';
Query OK, 0 rows affected (0.00 sec)
&lt;/pre&gt;&lt;p&gt;
Import the database:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cat /home/chris/transitionnetw_0.sql | mysql tnro
&lt;/pre&gt;&lt;p&gt;
Drop the &lt;tt&gt;users&lt;/tt&gt; table (couldn't think of a quick way to delete the &lt;tt&gt;pass&lt;/tt&gt; row from the &lt;tt&gt;users&lt;/tt&gt; table):
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql&amp;gt; DROP TABLE users;
Query OK, 0 rows affected (0.03 sec)
&lt;/pre&gt;&lt;p&gt;
That should do the job, the database, without the users data, can be accessed, read-only via &lt;a class="ext-link" href="https://parrot.transitionnetwork.org/phpmyadmin"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://parrot.transitionnetwork.org/phpmyadmin&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 02 Mar 2016 10:12:07 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:4</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.42&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.8&lt;/em&gt; to &lt;em&gt;1.22&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Updating the copy of the database on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;, on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer"&gt;PuffinServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;ssh -A puffin
sudo -i
cp /var/backups/mysql/sqldump/transitionnetw_0.sql /home/chris/
chown chris:chris /home/chris/transitionnetw_0.sql
exit
scp transitionnetw_0.sql parrot:
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
cat /home/chris/transitionnetw_0.sql | mysql tnro
&lt;/pre&gt;&lt;p&gt;
Then remove the users password hashes (just to be safe):
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql tnro
mysql&amp;gt; UPDATE users set pass="";
Query OK, 21644 rows affected (1.70 sec)
Rows matched: 21896  Changed: 21644  Warnings: 0
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 02 Mar 2016 10:21:05 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:5</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.22&lt;/em&gt; to &lt;em&gt;1.32&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
One odd thing, 6 weeks ago the datadase dump was 447M, see &lt;a class="ext-link" href="http://trac.edgewall.org/intertrac/ticket/896%23comment%3A3" title="ticket/896#comment:3 in Trac project trac"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;trac:ticket/896#comment:3&lt;/a&gt; but now it is 1.8G:
&lt;/p&gt;
&lt;pre class="wiki"&gt;ls -lah /var/backups/mysql/sqldump/transitionnetw_0.sql
-rw------- 1 root root 1.8G Mar  2 01:23 /var/backups/mysql/sqldump/transitionnetw_0.sql
&lt;/pre&gt;&lt;p&gt;
I have opened a new ticket for this: &lt;a class="new ticket" href="http://localhost:8080/trac/ticket/907" title="maintenance: TN Drupal database size (new)"&gt;ticket:907&lt;/a&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 02 Mar 2016 10:34:50 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:6</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:6</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.15&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.32&lt;/em&gt; to &lt;em&gt;1.47&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
So this size of the database has caused a diskspace issue on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  9.2G  241M  98% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  9.2G  241M  98% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  5.5G  3.0G  66% /home
&lt;/pre&gt;&lt;p&gt;
And this is without a dump of the &lt;tt&gt;tnro&lt;/tt&gt; database, the size of the current MySQL backups:
&lt;/p&gt;
&lt;pre class="wiki"&gt;ls -lah /var/backups/mysql/sqldump/
total 1.4G
drwx------ 2 root root 4.0K Jan 19 01:05 .
drwx------ 3 root root 4.0K Apr 30  2013 ..
-rw------- 1 root root 2.5M Mar  2 01:02 annesley.sql
-rw------- 1 root root 9.3M Mar  2 01:02 conference15.sql
-rw------- 1 root root 7.8M Mar  2 01:02 cop21.sql
-rw------- 1 root root 3.7M Mar  2 01:02 information_schema.sql
-rw------- 1 root root 542K Mar  2 01:02 mysql.sql
-rw------- 1 root root  17K Mar  2 01:02 performance_schema.sql
-rw------- 1 root root  11K Mar  2 01:02 phpmyadmin.sql
-rw------- 1 root root  63M Jun  2  2014 recon.sql
-rw------- 1 root root  57M Mar  2 01:02 reconomy.sql
-rw------- 1 root root  53M Mar  2 01:03 tc.sql
-rw------- 1 root root 1.3K Mar  2 01:03 test.sql
-rw------- 1 root root 424M Mar  2 01:06 tnro.sql
-rw------- 1 root root 1.9M Mar  2 01:06 ts.sql
-rw------- 1 root root 807M Mar  2 01:08 ttt.sql
-rw------- 1 root root 1.9M Mar  2 01:08 wpdev.sql
&lt;/pre&gt;&lt;p&gt;
So moving this directory to &lt;tt&gt;/home&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir /home/sqldump
chmod 700 /home/sqldump
rsync -av /var/backups/mysql/sqldump/ /home/sqldump/
rm -rf /var/backups/mysql/sqldump
cd /var/backups/mysql
ln -s /home/sqldump
df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  7.8G  1.7G  83% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  7.8G  1.7G  83% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  6.9G  1.6G  82% /home
&lt;/pre&gt;&lt;p&gt;
That should keep the server going for a while.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 03 Mar 2016 08:12:09 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:7</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.47&lt;/em&gt; to &lt;em&gt;1.97&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
We still have a disk space issue, in part because I kept a copy of the &lt;tt&gt;tnro&lt;/tt&gt; db from before it increased to 1.8G:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  8.1G  1.4G  86% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  8.1G  1.4G  86% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  8.5G     0 100% /home
&lt;/pre&gt;&lt;p&gt;
The &lt;tt&gt;sqldump&lt;/tt&gt; dir:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /home/sqldump/
ls -lah
total 3.1G
drwx------  2 root root 4.0K Mar  3 07:31 .
drwxr-xr-x 19 root root 4.0K Mar  2 10:30 ..
-rw-------  1 root root 2.5M Mar  3 01:04 annesley.sql
-rw-------  1 root root 9.3M Mar  3 01:04 conference15.sql
-rw-------  1 root root 7.9M Mar  3 01:04 cop21.sql
-rw-------  1 root root 3.7M Mar  3 01:04 information_schema.sql
-rw-------  1 root root 542K Mar  3 01:04 mysql.sql
-rw-------  1 root root  17K Mar  3 01:04 performance_schema.sql
-rw-------  1 root root  11K Mar  3 01:04 phpmyadmin.sql
-rw-------  1 root root  57M Mar  3 01:04 reconomy.sql
-rw-------  1 root root  53M Mar  3 01:04 tc.sql
-rw-------  1 root root 1.3K Mar  3 01:05 test.sql
-rw-------  1 root root 1.8G Mar  3 01:13 tnro.sql
-rw-------  1 root root 424M Mar  2 01:06 tnro.sql.old
-rw-------  1 root root 1.9M Mar  3 01:13 ts.sql
-rw-------  1 root root 806M Mar  3 01:15 ttt.sql
-rw-------  1 root root 1.9M Mar  3 01:15 wpdev.sql
&lt;/pre&gt;&lt;p&gt;
So moving some things back and symlinking some files.
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/backups/mysql/
ls -lah
total 8.0K
drwx------ 2 root root 4.0K Mar  2 10:33 .
drwxr-xr-x 3 root root 4.0K Mar  2 06:26 ..
lrwxrwxrwx 1 root root   13 Mar  2 10:33 sqldump -&amp;gt; /home/sqldump
rm sqldump
mkdir sqldump
chmod 700 sqldump/
rsync -av --exclude="tnro*" /home/sqldump/ /var/backups/mysql/sqldump/
sending incremental file list
./
annesley.sql
conference15.sql
cop21.sql
information_schema.sql
mysql.sql
performance_schema.sql
phpmyadmin.sql
reconomy.sql
tc.sql
test.sql
ts.sql
ttt.sql
wpdev.sql
sent 988219936 bytes  received 262 bytes  19964044.40 bytes/sec
total size is 988098475  speedup is 1.00
cd sqldump/
ln -s /home/sqldump/tnro.sql
cd /home/sqldump/
rm annesley.sql conference15.sql cop21.sql information_schema.sql mysql.sql performance_schema.sql phpmyadmin.sql reconomy.sql tc.sql test.sql ts.sql ttt.sql wpdev.sql
df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  9.0G  421M  96% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  9.0G  421M  96% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  7.6G  921M  90% /home
&lt;/pre&gt;&lt;p&gt;
That should buy a little time, creating a database for the old backup:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql&amp;gt; CREATE DATABASE tnro2;
Query OK, 1 row affected (0.00 sec)
mysql&amp;gt; GRANT SELECT ON tnro2.* TO 'tnro'@'localhost';
Query OK, 0 rows affected (0.04 sec)
&lt;/pre&gt;&lt;p&gt;
Import the data:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cat tnro.sql.old | mysql tnro2
&lt;/pre&gt;&lt;p&gt;
Create another symlink:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/backups/mysql/sqldump/
ln -s /home/sqldump/tnro2.sql
&lt;/pre&gt;&lt;p&gt;
Delete the old dump file:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rm /home/sqlbackup/tnro.sql.old
&lt;/pre&gt;&lt;p&gt;
Diskspace situation:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  9.3G   46M 100% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  9.3G   46M 100% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  8.3G  156M  99% /home
&lt;/pre&gt;&lt;p&gt;
So need to move another file:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/backups/mysql/sqldump
mv ttt.sql /home/sqldump/
ln -s /home/sqldump/ttt.sql
&lt;/pre&gt;&lt;p&gt;
Disk space situation:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  8.7G  717M  93% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  8.7G  717M  93% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  7.9G  537M  94% /home
&lt;/pre&gt;&lt;p&gt;
That should be OK for a little while, but later this month we will need to do one of these three options:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Delete the &lt;tt&gt;tnro&lt;/tt&gt; and &lt;tt&gt;tnro2&lt;/tt&gt; databases.
&lt;/li&gt;&lt;li&gt;Add additional disk space to &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Build a bigger replacement for &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;, running Debian Jessie.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
I think option 3. makes most sense as it would also bring some other enhancements.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Fri, 04 Mar 2016 13:14:42 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/896#comment:8</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/896#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.3&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.97&lt;/em&gt; to &lt;em&gt;2.27&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
The live database backup has been reduced from 1.8G to 379M so copying this to &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt; will also solve the disk space issues there.
&lt;/p&gt;
&lt;p&gt;
So, on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer"&gt;PuffinServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;ssh -A puffin
sudo -i
cp /var/backups/mysql/sqldump/transitionnetw_0.sql /home/chris/
chown chris:chris /home/chris/transitionnetw_0.sql
exit
scp transitionnetw_0.sql parrot:
sudo rm transitionnetw_0.sql
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="http://localhost:8080/trac/wiki/ParrotServer"&gt;ParrotServer&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
cat /home/chris/transitionnetw_0.sql | mysql tnro
mysql
mysql&amp;gt; DROP DATABASE tnro2;
Query OK, 293 rows affected (3.14 sec)
&lt;/pre&gt;&lt;p&gt;
Then remove the users password hashes and the dump (just to be safe):
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql tnro
mysql&amp;gt; UPDATE users set pass="";
Query OK, 21644 rows affected (1.70 sec)
Rows matched: 21896  Changed: 21644  Warnings: 0
rm /home/chris/transitionnetw_0.sql
&lt;/pre&gt;&lt;p&gt;
And I have done a backup of the databases and disk space wise everything looks OK:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  8.7G  744M  93% /
udev             10M     0   10M   0% /dev
tmpfs           307M  292K  307M   1% /run
/dev/xvda2      9.9G  8.7G  744M  93% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           818M     0  818M   0% /run/shm
/dev/xvda3      8.9G  6.5G  2.0G  78% /home
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>