Unable to restore backup

Hi,
I am having a problem restoring a back of my site.

During the restore I get this

Warning: ZipArchive::extractTo(/tmp/si_test/snapshot_manifest.txt): failed to open stream: Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 864

at the top of the page.

I also get this

We could not locate the wp-config.php file in your backup.

We could not locate the Snapshot manifest file in your backup.

in the snapshot migration window.

Need help,

Mike

  • Predrag Dubajic

    Hi Mike,

    Hope you're doing well.

    Can you grant support access to your source site where I can access the backup file so I could check it out and see if the issue is with the backup file itself?

    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5

    Please respond in this thread once access is granted.

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Mike,

    I'm afraid that support staff doesn't have access to member HUBs so I'm not able to download your files.

    Could you upload your backup to file sharing service like dropbox or google drive and send me the download link by using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Download link
    - Link back to this thread for reference
    - Any other relevant urls/info

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Mike,

    Thanks for sending that in.

    I tested your backup file on my site and it extracts properly there, and by the looks of the error the issue is that something on your server is preventing the files to be written inside either /tmp/ or /tmp/si_test/ folders.
    Can you check with your host about this and see why those folders are not writable?

    There's another issue with your backup I'm afraid, in your .htaccess file there's this rule:
    RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]
    The URL in there is exactly what's in the .htaccess file, so when the .htaccess is extracted from backup file it will redirect to that URL which is obviously wrong and it brakes the backup process.

    Can you tell me if your backup file was created on NGINX powered server?

    Best regards,
    Predrag

  • Mike Anderson

    Hi Predrag,

    That site is actually on a centos server.

    But I think I know what happened now, I used this site to be test migration to https. I was entering the details in .htaccess wp-config and got interrupted. The site must have backed up with the part modified .htaccess.
    Being one of my test servers, I didn't really concern myself with the interruption.

    In the end turns out that the https migration didnt require that particular rule. I was supposed have replaced the 'mysite' bit with the actual url. Which I subsequently did, but not until after the backups.

    I will have a look at the /tmp directories and see what going on there.

    Thanks for the insight. Much appreciated.
    I will fix the .htaccess and try the install again.

    Mike

    • Mike Anderson

      Hi again,

      I have been going back and forth with the support guys for our servers. They are saying that I need to ssh in to the server and set root permissions on /tmp directory for your restore script to run. Is the correct I have never needed to set any permission to allow a wordpress restore to run before.

      I was able to get the restore slightly further along but now I get this

      Warning: unlink(/tmp/si_test/snapshot_manifest.txt): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 1868

      Warning: rmdir(/tmp/si_test/www): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 1865

      Warning: unlink(/tmp/si_test/snapshot_manifest.txt): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 425

      Warning: Cannot modify header information - headers already sent by (output started at /home/nsisol/public_html/snapshot-installer.php:1868) in /home/nsisol/public_html/snapshot-installer.php on line 80

      This comes up after providing database credentials.

      I have just migrated all my sites from updraft to Snapshot, as I love the idea of a central 'Hub' for all my sites. Do I have to go through and set permissions on every server for each site I have?

      All previous backup software I have had just runs when you do a restore.

      Any light shedding would be much appreciated.

      As always thanks for your time, look forward to hearing from you,

      Mike

  • Predrag Dubajic

    Hi Mike,

    Did you configure the permissions only for /tmp/ folder of for the /tmp/si_test/ as well, since it looks like there are still some permission issues going on based on those warnings?

    Thing to take in consideration is that Snapshot is not a migration tool, even though we have number of confirmed cases that it worked in that way it is not something plugin was designed to do, that's why we working on a new thing for that.

    Why I'm saying this, when you're using Snapshot installer then you will need to configure permissions for the temp folder but when you do the restore process from the existing WP installation it will use WP temp folder instead and you will, in most cases, not need to adjust any additional permissions.

    Best regards,
    Predrag

  • Mike Anderson

    Hi Predrag,

    Nothing I have tried seems to have worked still get this same set of permissions errors.

    Warning: unlink(/tmp/si_test/snapshot_manifest.txt): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 1868

    Warning: unlink(/tmp/si_test/www/wp-config.php): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 1868

    Warning: rmdir(/tmp/si_test/www): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 1865

    Warning: unlink(/tmp/si_test/snapshot_manifest.txt): Permission denied in /home/nsisol/public_html/snapshot-installer.php on line 425

    Warning: Cannot modify header information - headers already sent by (output started at /home/nsisol/public_html/snapshot-installer.php:1868) in /home/nsisol/public_html/snapshot-installer.php on line 80

    Mike

  • Mike Anderson

    This is what I get for permissions

    on /tmp

    drwxrwxrwt 9 root root 4096 Dec 13 13:29 ./
    dr-xr-xr-x 23 root root 4096 Dec 12 01:21 ../
    drwxrwxrwt 2 root root 4096 Nov 19 2016 .font-unix/
    drwxrwxrwt 2 root root 4096 Dec 12 01:21 .ICE-unix/
    lrwxrwxrwx 1 root root 27 Oct 20 2016 mysql.sock -> ../var/lib/mysql/mysql.sock=
    drwxr-xr-x 3 root root 4096 Dec 12 01:21 si_test/
    srwxrwxrwx 1 postgres postgres 0 Dec 13 13:26 .s.PGSQL.5432=
    -rw------- 1 postgres postgres 47 Dec 13 13:26 .s.PGSQL.5432.lock
    drwx------ 3 root root 4096 Dec 12 01:21 systemd-private-c6902855fd224a0ea5b3c4e32ab455bf-named.service-qGoxKM/
    drwxrwxrwt 2 root root 4096 Dec 12 01:21 .Test-unix/
    drwxrwxrwt 2 root root 4096 Dec 12 01:21 .X11-unix/
    drwxrwxrwt 2 root root 4096 Nov 19 2016 .XIM-unix/
    nsisol@nsi.solutions [~]# cd /tmp
    nsisol@nsi.solutions [/tmp]# ls
    ./ .font-unix/ mysql.sock@ .s.PGSQL.5432= systemd-private-c6902855fd224a0ea5b3c4e32ab455bf-named.service-qGoxKM/ .X11-unix/
    ../ .ICE-unix/ si_test/ .s.PGSQL.5432.lock .Test-unix/ .XIM-unix/

    and on
    /tmp/si_test
    nsisol@nsi.solutions [/tmp]# ls -la si_test
    total 16
    drwxr-xr-x 3 root root 4096 Dec 12 01:21 ./
    drwxrwxrwt 9 root root 4096 Dec 13 13:31 ../
    -rw-r--r-- 1 root root 3908 Dec 3 17:21 snapshot_manifest.txt
    drwxr-xr-x 2 root root 4096 Dec 12 01:21 www/
    nsisol@nsi.solutions [/tmp]#

  • Predrag Dubajic

    Hi Mike,

    Did you get any additional info from your host because the warnings are clearly stating that the permissions are still incorrect?

    The thing is that snapshot-installed can't do its thing without the server allowing it to write temporary files in order to restore your files.

    I'm not a server expert, but some research shows that drwxrwxrwt does open access to all but the "t" at the end does limit it to file owner as I understand.
    Not sure if that could be the cause of this so it's worth checking that with your host.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.