Forum

Thread tagged as: Question, Problem, Runway

Local restore of backup

Hi

I have followed the dropbox part of the runway backup, on widows with xampp you can not do this because of 32 bit php,

I have successfully backup the database and resources on out testing servers works great, also restore great,

My problem is trying to restore on a local machine, as i understand you create the same buckets.php as the testing server, when i choose restore the dropbox /bucket apears but there are no files in it to restore.

Do you need to create the dropbox credentials in runway.php the same as the testing server

What am i missing

Regards,

brett

Brett Warne

Brett Warne 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you need to add your Dropbox credentials, else Runway can't access your Dropbox account.

I'm not sure what you're saying about 32 bit PHP.

I added the same runway.php config as the server.

here is the error you get in xampp on windows, you also get it in wamp

dropboximage

it does seem to access the account it just can not see any backups

Drew McLellan

Drew McLellan 2638 points
Perch Support

I see, yes, you'll need to run a 64 bit system.

We have a Vagrant box configuration if that helps https://github.com/PerchCMS/perch-vagrant

Which version of Windows are you running that is still 32 bit?

No it'd 64 bit I think the issue is xampp is 32 bit, even if I download the 64 bit version of wamp it happens.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So in a 64 bit environment you still get an error about it not being 64 bit?

It appears so, I am not sure if having the 32 bit version of xampp is the issue, it appears that the 64 bit version of wamp still has the 32 bit version of php

Drew McLellan

Drew McLellan 2638 points
Perch Support

You'll need to get that sorted in order to use the Dropbox functionality.

Hi

The above stops you backing up locally, it should not stop restoring, or should it. If you choose restore you see the Dropbox//bucket name but when you choose browse files you do not see any. On the testing server you do.j

Hi I have tracked down the cause, it a windows issue, does not matter if it is 32 bit or 64 bit

On windows x86_64, PHP_INT_MAX is 2147483647. This is because in the underlying c-code, a long is 32 bit.

if you modify RequestUtil.php in apps/dropbox/lib.dropbox/ by commenting the below out

if (strlen((string) PHP_INT_MAX) < 19) {
    // Looks like we're running on a 32-bit build of PHP.  This could cause problems because some of the numbers
    // we use (file sizes, quota, etc) can be larger than 32-bit ints can handle.
    throw new \Exception("The Dropbox SDK uses 64-bit integers, but it looks like we're running on a version of PHP that doesn't support 64-bit integers (PHP_INT_MAX=" . ((string) PHP_INT_MAX) . ").  Library: \"" . __FILE__ . "\"");
}

everything works and you can restore the backups.

Not sure if you can do anything about this but it means that anyone with a windows pc, 32 bit or 64 can not use the restore function with the workaround above.

it does mention

If I were you, I'd write my own Dropbox API implementation using strings and not integers

Regards,

Brett

Drew McLellan

Drew McLellan 2638 points
Perch Support

We're using the official Dropbox PHP SDK, which doesn't seem unreasonable. I'd love to have the time available to write my own integration but that's simply not realistic for software at this price point.

I'll add a note to the requirements that 64 bit integers are required for Dropbox.

I'd really recommend taking a look at the vagrant box linked above. It's very simple to get a VM up and running with vagrant, and then you have a proper environment to develop in rather than cobbled together Windows solutions.

Hi Drew

Is it possible for a windows version of perch-vagrant to be compiled

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I don't have a Windows machine to test on.

There isn't much special about it, you could use something like https://puphpet.com/ to configure something specific for your environment.

Hi

Just to let you know that i got the Vagrant/puphpet to work after many, many attempts, if anyone on windows would like to know how let me know.

Thanks for your help

Regards,

Brett

Drew McLellan

Drew McLellan 2638 points
Perch Support

Great!