-
-
Notifications
You must be signed in to change notification settings - Fork 641
Acquia Drush Aliases sql-sync to VirtualBox #406
Comments
First of all, you mention you ran If you run As the error is rsync i assume you gets past this.
Afterwards come some rsync commands. Maybe you can try running the failed rsync commands manually. What's the output? Also are you on windows or linux? Which |
Thanks for catching that typo above. I've corrected my post.
I was wondering if this could be the problem but I think I need Drush 7 so that I can run Here's the output I'm seeing - (line breaks inserted so I could more easily trace through)
Haven't yet had a chance to run each of these commands manually. |
I've also had issues trying to use sql-sync between two remote hosts. Check out the answers on this drupal.stackexchange post on the topic. http://drupal.stackexchange.com/questions/135401/how-to-sql-sync-database-between-two-remotes-which-share-the-same-host Also... you can still use drush registry_rebuild with drush 8... you just need to manually download it to your ~/.drush folder. At least that is what I've done and it "seems" to work for me. :) |
Worth a try using |
I feel like the alias should have been expanded in the failing command
Note the vs the ssh commands:
When I run |
Aha so it fails because the rsync command runs on the VM, which does not have access to your acquia site alias (while it is available for the initial SSH command on your host machine). On my own projects I have my production aliases defined within With Drush v6.7 it did the following:
Which would work. But they apparently have changed it since then... |
The simplest way to synchronize the database from a remote source into a site in a VM from outside the VM is:
|
(Which is also mentioned in the linked answer from @caschbre) |
Thank you guys so much for the helpful feedback. @geerlingguy - Piping the sql-dump directly to the vm alias via sql did the trick. I'm still not sure why the |
Did you try moving the alias definitions to the VM as well? I feel like that should have fixed the issue. And if it did, could be worth adding to the docs. |
That could work, yeah... I might try this out for some testing I'm doing today, if I get a chance. |
Based on some further research I'm thinking this actually might be a larger issue with vagrant and rsync on windows. Based on this post:
Further Reference: I came back to this issue when exploring using rsync instead of NFS on my windows host and now I'm seemingly getting the same error:
I don't know enough about Vagrant or the underlying mechanism that is doing the path rewriting but rsync is still totally not working for me. |
@justinlevi - Yeah, rsync only really works in some particular scenarios on windows... I've usually told people to stick with SMB or to use winnfsd if they can get it to work reliably, because rsync has so many weird corner cases and native shares are by far the slowest option. |
In general we found issues in Windows with directories/files that are shared between the VM and host OS. Most especially if there are symlinks involved, because they are handled so differently, but also there is some "incompatibility" on the permissions/ownership site. I haven't tried winnfsd yet, maybe that is a solution... |
@itsgreggmarshall - Yeah, so far my best luck has been with native or SMB synced folders in Windows 10 at least. With winnfsd I've hit little issues with symlinks and permissions, and with rsync I run into similar issues as @justinlevi has mentioned. But I'm not using Windows as my daily driver... just trying to help some poor souls who are forced to stay on Windows have 1-2s page load times instead of 5-10s :P |
The hurdles you need to jump through in order to do Drupal, or web development in general, on a Windows host is really problematic. Time and time again it feels like you are severely handicapped if you are stuck with a Windows dev environment. I realize I'm just venting but it's frustrating to see sub 1 second page load times with almost zero configuration on a mac and then try to do the same on Windows and just get chopped off at the knees time and time again. |
@justinlevi - Yeah, the main problem is that almost all the OSS webdev tool builders I know (anecdote, but probably pretty accurate) use either Mac OS X or some flavor of Linux and presume you have a POSIX-like environment, SSH, etc. Therefore, of the few tools that do support Windows, most of them have support that's maintained by a downstream user of the tool, and not necessarily by the main maintainers. Drupal VM used to be like that until I went and bought a used Lenovo with Windows 8 and Windows 10 on it (all on my own dime) so I could do sanity checks in Windows and share the pain of the devs who use Drupal VM on Windows. Honestly, I've considered throwing in the towel and dropping official Windows support from time to time. I spend maybe 1-2 hours a month dealing with environment issues for Fedora, Ubuntu, Arch, Mac OS X, etc... and probably 20-80 hours a month with the same for Windows. Supporting Windows at all comes with a major cost. And with OSS, would you rather have a tool with more optimizations, features, speed, and accessibility, or have maintainers burn time just making it limp by on Windows. That's the gist of the issue. And upstream from Drupal VM, a lot of the other tools are also developed with a Windows-last philosophy, which doesn't make it any easier on me :P |
Ironically, our one trouble spot with the PSO generated Drupal VM is on a Ubuntu 14.04 machine, it appears to be permissions with Phing. I was going to just use Linux to see if it made more sense, but am back to Windows for now. |
Running this command on OSX command line:
results in:
|
Hmm... I can't tell. I will try again after manually destroying the local On Mon, Feb 29, 2016 at 10:40 AM, Oskar Schöldström <
|
Yes, I deleted my local db and this command did in fact, work. There is just a message on the terminal that looks like an error. |
What exactly should be documented here? I'm a bit lost to be honest :) A clarification about Is something about |
Yes, basically :) For sync, let's leave things be for now. I still have more testing to do before recommending anything particular. |
I really need to get a new Drupal project at work so I can do some more testing as well. Currently all our sites use an older drush version where |
Hey all, I had some issues with drush sql-sync as well. I initially got the "it cannot sync between to remotes" error and the after messing around and updating things I got a permissions issue. Anyways so I decided to move my Acquia drush.alias inside the VM, now things work great. I don't even bother doing drush commands outside the VM. Here is what I'm using |
@oxyc @geerlingguy I ran drush @drupaldev.dev sql-dump > C:\Drupal8_Applications\test_sai.sql | drush @drupalvm.local sql-cli < C:\Drupal8_Applications\test_sai.sql It ignores the second command after the pipe. Even when I run the commands individually (dump and restore), the sql-cli works only after I drop the destination db and then run sql-cli. Then I would need to run http://drupalvm.dev/core/rebuild.php Can I run import and restore without dropping the VM database.? |
I'm wondering if these were the options I had to add to get sql-sync working between two remotes: https://github.com/generoi/genero-conf/blob/master/drush/aliases.drushrc.php#L5:L6. I wrote the base for this file too long ago to remember the exact reason behind it. |
I just tested The VMs alias installed on the host computer needs to avoid 'ssh-options' => '-o PasswordAuthentication=no -i ' . $_SERVER['HOME'] . '/.vagrant.d/insecure_private_key' That's all I needed to get it working. |
Hmm all I need is: $aliases['drupalvm.dev'] = array(
'uri' => 'drupalvm.dev',
'root' => '/var/www/drupalvm/drupal',
'remote-host' => 'drupalvm.dev',
'remote-user' => 'vagrant',
'ssh-options' => '-o PasswordAuthentication=no -i ' . $_SERVER['HOME'] . '/.vagrant.d/insecure_private_key',
); and then the remote $aliases['remote.fi'] = array(
'uri' => 'remote.fi',
'root' => '/var/www/staging/project/current',
'remote-host' => 'remote.fi',
'remote-user' => 'oxy',
); |
What happens if you remove Edit: I ran it from the host. Went something like
|
At least in my case the dump file which fails for you is rsynced to my host computer. And window doesn't have |
@oxyc Can you please send me the log of what you see when you run sql-sync. Add -vd flag. |
@smallela1 I'm having some issues with my connection at the moment. I'll post it once I get everything working again. Meanwhile I'm doing some research into this:
Upstream issue for this original report: drush-ops/drush#2047 @smallela1 which drush versions do you have running on the host, the guest and on acquia? |
Here's what I believe we should test: Requirements:
Test:
|
@oxyc Do you we need these tests done on Mac as well or Windows only? |
I cant test them on Mac once I get my VM provisioned (major connection issues going on today). But would be great if we had more to test as well. I've never used acquia services either. Are they somehow locked to older drush versions? Seems that might be one of the issues that needs testing here as well. For docs I think we need to figure out:
|
on OSX it works with mixed drush 8.0.5 and 9.0-dev versions. https://gist.github.com/oxyc/923e56fde9d38bac2fc2add78931375b |
Ok great I'll test it too and report it back. I've been using it with Acquia and Pantheon and it all works for me, but I'll go through your test steps. BTW Acquia runs on Drush 8.0.1 or 7.1.0 and Pantheon runs on 8.0.5 |
Using Drush 8.0.5 on host and guest |
…rush versions [ci skip]
Yes I can confirm it's working on Mac, I spin a new VM from latest master and I was able now to sql-sync from host |
Thanks for testing! That makes sense yes. I added some WIP docs mentioning Drush 8.0.3 is a requirement for the host machine, which I think is a fairly easy dependency to follow right? The remote is the one which could be locked to an outdated version. For Drush 7 on the host, it should still work if you transfer the Here's the required change, which is unavailable in Drush 7 |
…rush versions [ci skip]
Test cases for someone with windows: This requires you to have the latest master of Drupal VM. More specifically commit e1fea4b.
If one of those fails. Try copying your
|
[WIP] Issue #406: Add docs about sql-sync workaround for older drush versions
If nothing else, I'll try to spin up my Win10 environment tomorrow or Tuesday before I head off for vacation. No promises! |
@oxyc - Can you submit a PR with these changes, and we'll run with them? I think we're good enough to go with what we have, and then we can adjust the commands/docs if needed moving forward. I don't want to let this issue sit forever :) |
The PR you merged earlier has all the changes already I think oxyc@ca349e2. The only issue is that it hasn't been verified on windows. I'm pretty confident our docs are correct now and if there are any issues, they are in fact drush bugs. |
Okay, I'm going to close this issue then. We can open up follow-ups if anything's incorrect, or push stuff off to Drush :P |
So one thing I've been struggling with is figuring out a workflow for getting the Drupal-VM database setup using
sql-sync
to an Acquia Cloud site. I'd like to get the Drupal-VM synchronized with an existing Drupal project checked out from Acquia (via DevDesktop although it could just as well be a git clone via command line).Here's how I'm thinking it should work:
vagrant up
vagrant up
completes, but I'd be happy if I could just get the workflow sorted out manually to start...So, here's where I'm at:
My VM is setup and working great. I can
vagrant ssh
in and verify that ssh-agent is forwarding correctly to the host by runningssh -T git@github.com
as I get the expected message:Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
I can create a new drush alias to the Drupal-VM no problem by adding the following into
<SITE ROOT>/../drush/virtualbox.aliases.drushrc.php
:I can then run
drush @virtualbox.local status
, entervagrant
for my pw and everything works as expected.haha - In doing the above and running
drush sa
I realized aliases were already being created to all of the virtual hosts defined in the config. oops.Regardless though, this is where I get stuck. If I then try to sync with the Acquia DB running
drush sql-sync @<ACQUIA-DRUSH-ALIAS>.dev @drupalvm.drupalvm.dev
I consistently get a rsync error. I think this might have something to do with trying to rsync between two remote hosts. I feel like I've read somewhere that rsync doesn't like that.
Here's the full error I'm seeing:
I also tried
drush @<ACQUIA-DRUSH-ALIAS>.dev sql-dump | drush @drupalvm.drupalvm.dev sql-cli
with no luck even though I can create the sql file no problem withdrush @<ACQUIA-DRUSH-ALIAS>.dev sql-dump > sqldump.sql
I found a project called
Drush SQL Sync Pipe
that looks promising but wanted to check here before I start going down that road.https://www.drupal.org/project/drush_sql_sync_pipe
@geerlingguy - Any help is greatly appreciated. Thanks!
Oh, a few more notes.
sql-sync
on the host and not within the vagrant ssh. Mainly because I don't have access to all of my Acquia aliases.UPDATE
I ended up installing Drush SQL Sync Pipe and was able to get the DB from the Acquia Dev site and push it up to the Virtual Box.
drush sql-sync-pipe @<ACQUIA-DRUSH-ALIAS>.dev @drupalvm.drupalvm.dev --progress
I'm not sure if this is the correct approach though and now I'm running into some php issues that I'm not seeing on dev desktop or on Acquia Dev oddly enough.
The text was updated successfully, but these errors were encountered: