Backup from a vagrant machine

192 views
Skip to first unread message

xavier-...@live.be

unread,
Aug 2, 2016, 11:10:03 AM8/2/16
to ICA-AtoM Users
Hello everyone,

I've tested AtoM for quite a moment now using a vagrant machine. I wish now to move to a "real" server, and so need to create a backup of my actual AtoM. I checked the instructions from the wiki, linking to the wordpress backup page (https://codex.wordpress.org/Backing_Up_Your_Database). The command line required to make the backup needs a "mysql_hostserver", which I guess being the default "10.10.10.10", a "mysql_username" which is doubtlessly "root", and a "mysql_databasename", and for that one, I have no idea what it can be. Does any of you know what the default database name is in such a case?
Thank you in advance!

Dan Gillean

unread,
Aug 2, 2016, 1:05:14 PM8/2/16
to ICA-AtoM Users
Hi Xavier,

The database name in the Vagrant box is probably "atom" but if you want to double-check, try looking in the config/config.php file - the information should be in there. See:

Cheers,


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/50ca1dc2-1415-45d8-b01a-cf53507bb5ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xavier-...@live.be

unread,
Aug 2, 2016, 3:03:16 PM8/2/16
to ICA-AtoM Users
Thank you! Seems like you're right. But I was mistaken about the "mysql_hostserver", which is not the url (10.10.10.10 by default)
Once I introduce the command line ( mysqldump --add-drop-table -h http://10.10.10.10 -u root -p atom ), and add the password as asked, I get the following error message :

mysqldump: Got error: 2005: Unknown MySQL server host 'http://10.10.10.10' (0) when trying to connect

The url is indeed the url I use to go on my AtoM, but I guess the url itself is not really the host of my AtoM as I'm using a Vagrant VM... Do you have any idea where I have to search? Can it be a file, or can the url thing still be valid?
Thank you in advance!

Jesús García Crespo

unread,
Aug 2, 2016, 3:18:30 PM8/2/16
to ica-ato...@googlegroups.com
Hi Xavier,

I don't think you can connect to the MySQL server inside the Vagrant box from outside. Instead, try logging in running `vagrant ssh` from the same location where the `Vagrantfile` is located. Once you are in, run `mysqldump -hlocalhost -uroot -proot atom > /vagrant/dump.sql`. When it completes, type `exit` and the file should be right here.

I've uploaded a terminal session to show you how I did it: https://asciinema.org/a/0uxhgb2pmerk8cb3tnklkkbnl

Let us know how it goes!


For more options, visit https://groups.google.com/d/optout.



--
Jesús García Crespo,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | +1.604.527.2056

xavier-...@live.be

unread,
Aug 3, 2016, 9:07:02 AM8/3/16
to ICA-AtoM Users
Thank you for your answer! 
I tried applying the command line, but I got the following error message :
-bash: /vagrant/dump.sql: Permission denied
Any idea how I could solve the problem? I am new at using Linux and its command line system, so maybe the answer is quite simple...
Thank you and advance and thank you for your answers until now!

Le mardi 2 août 2016 21:18:30 UTC+2, Jesús García Crespo a écrit :
Hi Xavier,-bash: /vagrant/dump.sql: Permission denied

Dan Gillean

unread,
Aug 3, 2016, 11:43:30 AM8/3/16
to ICA-AtoM Users
Hi Xavier,

You can first try to reset the permissions in the Vagrant box. In a normal server-based production instance, the www-user is granted the read/write permissions, but in the vagrant box, it is the vagrant user. You can try resetting the permissions like so:
  • sudo chown -R vagrant.vagrant /usr/share/nginx/atom

Now try the command again.

If it still doesn't work, try running it with "sudo" before the command, like so:

  • sudo hlocalhost -uroot -proot atom > /vagrant/dump.sql

Let us know if that works. The file should then be available in the directory on your host machine wherever you first ran the vagrant installation commands.

Cheers,


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

xavier-...@live.be

unread,
Aug 3, 2016, 6:45:17 PM8/3/16
to ICA-AtoM Users
I'm afraid it's still not working. I tried both command line, but it seems it didn't change the permissions I required.
So, here follow the command lines I ended up trying and the answers I received.

xavier@xavier-Latitude-E6520:~/Documents/AtoM$ vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-49-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

            ,,,,,,,,,,,,,,,
         ,,,,,,,,,,,,,,,,,,,,,
      ,,,,,,,,,,,,,,,,,,,,,,,,,,,
     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
   ,,,,,,,,,,,,,           ,,,,,,,,,
  ,,,,,,,,,,,      ,,,       ,,,,,,,,
 ,,,,,,,,,,   ,,,,,,,,,,,     ,,,,,,,,
 ,,,,,,,,    ,,,,,,,,,,,,,    ,,,,,,,,
,,,,,,,,     ,,,,,,,,,,,,,     ,,,,,,,,
,,,,,,,,    ,,,,,,,,,,,,,,,    ,,,,,,,,
,,,,,,,,    ,,,,,,,,,,,,,,,    ,,,,,,,,
,,,,,,,,,   ,,,,,,,,,,,         ,,,,,,,,
,,,,,,,,,,,,,,,,,,       ,,,    ,,,,,,,,
,,,,,,,,,,,,,,,      ,,,,,,,    ,,,,,,,
,,,,,,,,,,,,     ,,,,,,,,,,,     ,,,,,,
,,,,,,,,,,,    ,,,,,,,,,,,,,,    ,,,,,,
 ,,,,,,,,,    ,,,,,,,,,,,,,,     ,,,,,
 ,,,,,,,,     ,,,,,,,,,,,,,       ,,,,
  ,,,,,,,     ,,,,,,,,,,,   ,,
   ,,,,,,,      ,,,,,,     ,,,,
     ,,,,,,             ,,,,,,,,,,
      ,,,,,,,        ,,,,,,,,,,,,
         ,,,,,,,,,,,,,,,,,,,,,
            ,,,,,,,,,,,,,,,
                  ,,,                 AtoM 2

                                      - Web https://www.accesstomemory.org
                                      - Vagrant help: http://goo.gl/dkyZ4g
                                      - AtoM: http://10.10.10.10

--------------------------------------------------------------------------------
Last login: Wed Aug  3 22:29:32 2016 from 10.0.2.2
[~]
vagrant$ sudo chown -R vagrant.vagrant /usr/share/nginx/atom
[~]
vagrant$ mysqldump -uroot -proot atom > /vagrant/dump.sql
-bash: /vagrant/dump.sql: Permission denied
[~]
vagrant$ sudo hlocalhost -uroot -proot atom > /vagrant/dump.sql
-bash: /vagrant/dump.sql: Permission denied
[~]
vagrant$ 

As you can see, I have no problem using the Vagrant ssh command line, and I didn't receive anything letting me think that the "chown" command line did work or not. But it is quite strange the "sudo hlocalhost" line isn't working either.
Would you have any further idea of how I could solve this?
Thank you already guys!

Dan Gillean

unread,
Aug 5, 2016, 10:38:09 AM8/5/16
to ICA-AtoM Users
Hi Xavier,

I'm a bit stumped. Can you run the command with sudo without referring to the localhost? E.g.
  • sudo mysqldump -u root -proot atom > /vagrant/dump.sql

Let us know if that works. The other thing to double check is that you're password is in fact root - it could be causing problems if the password is not in fact that. Can you check in the config/config.php file to verify that?


Cheers,


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.

xavier-...@live.be

unread,
Aug 8, 2016, 4:01:25 PM8/8/16
to ICA-AtoM Users
It finally worked quite well, thank you! Seems like, once in the Vagrant VM, it was unnecessary to use any database name.
Thank you all for your help, and your time and understanding! It is truly appreciated.
Bye,

Xavier

Dan Gillean

unread,
Aug 8, 2016, 4:26:24 PM8/8/16
to ICA-AtoM Users
Thanks for letting us know, Xavier, I'm glad it worked!

Cheers,

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages