Restoring a Backup fails

45 views
Skip to first unread message

Addy

unread,
May 27, 2013, 5:25:29 AM5/27/13
to erpnext-dev...@googlegroups.com
Hi

I tried to restore a backup from a later version of erpnext to an older version of erpnext in a different account and it broke the old version of the erpnext and this is what I did:


[root@rigpl ~]# cd /var/www/sites/XXX
[root@rigpl XXX]# lib/wnf.py --backup
backup taken - /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql.gz - on
2013-05-25 14:02:03
[root@rigpl XXX]# gunzip /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
[root@rigpl XXX]# lib/wnf.py --install test_rigpl /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
MySQL root password:
Created user test_rigpl
Created database test_rigpl
Granted privileges to user test_rigpl and database test_rigpl
Starting database import...
Imported from database /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
/var/www/sites/XXX/lib/webnotes/db.py:124: Warning: Table
'__Auth' already exists
self._cursor.execute(query)

Now after I got this error I am unable to access the account where I was trying to restore the backup.

Rushabh Mehta

unread,
May 27, 2013, 5:26:32 AM5/27/13
to erpnext-dev...@googlegroups.com
Thats only a warning - update the db_name property in conf.py and it should work.


--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/901bd1f9-cff6-4e00-83a0-7028b5037878%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Addy

unread,
May 27, 2013, 5:45:20 AM5/27/13
to erpnext-dev...@googlegroups.com
Even if its a warning something really has messed that account as I am unable to access it, the error message I get when I just browse through the website is enclosed , the landing page of the website loads fine but the other webpages are just giving me the error and also I am not able to login.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Error.txt

Anand Doshi

unread,
May 27, 2013, 5:46:53 AM5/27/13
to erpnext-dev...@googlegroups.com
Hi Aditya,

You will need to use the id and password applicable to the source database, as the profiles also get copied.

Thanks,
Anand.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
<Error.txt>

Aditya Duggal

unread,
May 27, 2013, 5:51:27 AM5/27/13
to erpnext-dev...@googlegroups.com
I have tried to use id and password from source db as well and there is no message for failed login just that that the system stops to respond when we enter a password showing that the system is not running at all.


Anand Doshi

unread,
May 27, 2013, 7:32:25 AM5/27/13
to erpnext-dev...@googlegroups.com
Hi Aditya,

Most probably your test system was not updated, but the source database has been patched using an updated instance of erpnext.

You can try after running this in your test folder:
lib/wnf.py --patch_sync_build 

Thanks,
Anand.

Anand Doshi

unread,
May 27, 2013, 7:33:25 AM5/27/13
to Anand Doshi, erpnext-dev...@googlegroups.com
Hi Aditya,

Run this instead of patch_sync_build

lib/wnf.py --update origin master
chown -R apache:apache *

Thanks,
Anand.

Aditya Duggal

unread,
May 27, 2013, 11:15:01 PM5/27/13
to erpnext-dev...@googlegroups.com
Hi Anand,

Just tried to run the command to update the master and got this error, I did run the second command as well but nothing seemed to happen.

[root@rigpl test.rigpl.com]# lib/wnf.py --update origin master
Traceback (most recent call last):
  File "lib/wnf.py", line 501, in <module>
    run()
  File "lib/wnf.py", line 323, in run
    webnotes.connect(conf.db_name)
  File "/var/www/sites/test.rigpl.com/lib/webnotes/__init__.py", line 164, in co                       nnect
    conn = webnotes.db.Database(user=db_name, password=password)
  File "/var/www/sites/test.rigpl.com/lib/webnotes/db.py", line 53, in __init__
    self.connect()
  File "/var/www/sites/test.rigpl.com/lib/webnotes/db.py", line 65, in connect
    use_unicode=True, charset='utf8')
  File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Con                       nect
    return Connection(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in                        __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'test_rigpl'@                       'localhost' (using password: YES)")



Rushabh Mehta

unread,
May 28, 2013, 2:43:05 AM5/28/13
to erpnext-dev...@googlegroups.com
Aditya,

Set the correct db_password password in conf.py

- Rushabh


W: https://erpnext.com
T: @rushabh_mehta

Aditya Duggal

unread,
Jun 2, 2013, 10:47:57 AM6/2/13
to erpnext-dev...@googlegroups.com
I am not able to understand which password am I supposed to update on the conf.py since none seem to be provided to me for the db or I am missing it, kindly please let me know which password are we talking about, basically I don' t have the password.


Anand Doshi

unread,
Jun 2, 2013, 11:03:37 AM6/2/13
to erpnext-dev...@googlegroups.com
Hi Aditya,

You were installing from the incorrect folder. You don't need to change the password.

Suppose you took backup of instance in folder XXX

To install into YYY, you need to go to folder YYY and then run the install command. After install run the update command and it should work.

Thanks,
Anand.

Aditya Duggal

unread,
Jun 2, 2013, 11:09:28 AM6/2/13
to erpnext-dev...@googlegroups.com
I understand that and that is what I did on 28-May.
I took a backup from erp folder and then went to the test folder to run all the commands but got the error which is on the post of 28-May.

Am I missing something?


Anand Doshi

unread,
Jun 2, 2013, 11:14:15 AM6/2/13
to erpnext-dev...@googlegroups.com
Hi Aditya,

I read your original post and commented. There is no mention of changing directory. 


[root@rigpl ~]# cd /var/www/sites/XXX
[root@rigpl XXX]# lib/wnf.py --backup
backup taken - /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql.gz - on
2013-05-25 14:02:03
[root@rigpl XXX]# gunzip /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
[root@rigpl XXX]# lib/wnf.py --install test_rigpl /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
MySQL root password:
Created user test_rigpl
Created database test_rigpl
Granted privileges to user test_rigpl and database test_rigpl
Starting database import...
Imported from database /var/www/sites/
XXX/public/backups/20130525_36264422_database.sql
/var/www/sites/XXX/lib/webnotes/db.py:124: Warning: Table
'__Auth' already exists
self._cursor.execute(query)

Thanks,
Anand.

Aditya Duggal

unread,
Jun 2, 2013, 1:13:46 PM6/2/13
to erpnext-dev...@googlegroups.com
Hi Anand,

I did change the directory to the one where I wanted to install that is YYY instead of XXX.
Now to confirm I just tried doing this again and this time again I changed the directory to YYY and then run the install command but again I get this error:

[root@]# lib/wnf.py --install test_rigpl /var/www/sites/XXX/public/backups/ABC.sql
MySQL root password:
Created user something
Created database somethin
Granted privileges to user something and database something
Starting database import...
Imported from database /var/www/sites/XXX/public/backups/ABC.sql
/var/www/sites/YYY/lib/webnotes/db.py:124: Warning: Table '__Auth' already exists
  self._cursor.execute(query)



Anand Doshi

unread,
Jun 3, 2013, 2:48:33 AM6/3/13
to erpnext-dev...@googlegroups.com
Hi Aditya,

Warning about __Auth table is okay. Are you now able to login?

Thanks,
Anand.

Reply all
Reply to author
Forward
0 new messages