Hot to Mirror Hosted erpnext account on a separate machine for Testing Purposes?

117 views
Skip to first unread message

Aditya Duggal

unread,
Dec 17, 2012, 10:44:09 PM12/17/12
to erpnext-dev...@googlegroups.com
Hi,

First of all, I would like to present my sincere apologies to the developing team for the unintentional but still extremely catastrophic effects of my queries on the server.

I have recently downloaded the VM image for erpnext from the website and to be honest this is the first time I have been able to login to the offline system. Now my real query is that how can I make an exact copy of my online account with the DB and the customizations so that I could do thorough testing before doing any harm to the system in use for others.

Any help in this regards would be deeply appreciated.

Rushabh Mehta

unread,
Dec 18, 2012, 2:25:02 AM12/18/12
to erpnext-dev...@googlegroups.com
Aditya,

We are still not sure what caused the outage - our logs did not show up anything, it could be the query we are not sure yet.

To make your local copy, download you backup on your virtual machine, unzip it and go to the erpnext  folder and execute:

lib/wnf.py --install [dbname] [path to the download]

best,
Rushabh


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

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/2WDjsPBW1EAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Aditya Duggal

unread,
Dec 18, 2012, 11:47:38 PM12/18/12
to erpnext-dev...@googlegroups.com
Hey,

I created a DB RIGPL before importing and then ran the above command to import the DB over the existing one and then I just go this error, and it also seems that the DB was not imported since there are no transactions on the frontend.

Imported from database /backup/20121219_13884459_database.sql
/var/www/erpnext/lib/webnotes/db.py:147: Warning: Table '__Auth' already exists
  self._cursor.execute(query)
Ran framework startups on RIGPL


And it seems that no data was imported

On Tuesday, December 18, 2012 12:55:02 PM UTC+5:30, rushabh wrote:
Aditya,

We are still not sure what caused the outage - our logs did not show up anything, it could be the query we are not sure yet.

To make your local copy, download you backup on your virtual machine, unzip it and go to the erpnext  folder and execute:

lib/wnf.py --install [dbname] [path to the download]

best,
Rushabh


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

On 18-Dec-2012, at 9:14 AM, Aditya Duggal <aditya...@gmail.com> wrote:

Hi,

First of all, I would like to present my sincere apologies to the developing team for the unintentional but still extremely catastrophic effects of my queries on the server.

I have recently downloaded the VM image for erpnext from the website and to be honest this is the first time I have been able to login to the offline system. Now my real query is that how can I make an exact copy of my online account with the DB and the customizations so that I could do thorough testing before doing any harm to the system in use for others.

Any help in this regards would be deeply appreciated.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
Dec 18, 2012, 11:48:45 PM12/18/12
to erpnext-dev...@googlegroups.com
Aditya,

You can ignore that warning - did you change the dbname in conf.py?

- Rushabh



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

To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/QDLxKZfl_XgJ.

Aditya Duggal

unread,
Dec 19, 2012, 12:07:08 AM12/19/12
to erpnext-dev...@googlegroups.com
Changed the DB Name to RIGPL but did not change the password which is same as the default one.

Now I am getting this error when I log into the system.

--> --> -->
 
 
<class '_mysql_exceptions.OperationalError'>
Python 2.7.3: /usr/bin/python
Wed Dec 19 10:36:49 2012

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /var/www/erpnext/public/web.py in ()
     44         return website.utils.render(webnotes.form_dict.get('page'))
     45 
     46 if __name__=="__main__":
=>   47         init()
     48         respond()
init = <function init>
 /var/www/erpnext/public/web.py in init()
     37         import webnotes.handler
     38         webnotes.handler.get_cgi_fields()
=>   39         webnotes.connect()
     40 
     41 def respond():
webnotes = <module 'webnotes' from '../lib/webnotes/__init__.pyc'>, webnotes.connect = <function connect>
 /var/www/erpnext/lib/webnotes/__init__.py in connect(db_name=None, password=None)
    163         import webnotes.db
    164         global conn
=>  165         conn = webnotes.db.Database(user=db_name, password=password)
    166         
    167         global session
global conn = None, webnotes = <module 'webnotes' from '../lib/webnotes/__init__.pyc'>, webnotes.db = <module 'webnotes.db' from '../lib/webnotes/db.pyc'>, webnotes.db.Database = <class webnotes.db.Database>, global user = None, db_name = None, password = None
 /var/www/erpnext/lib/webnotes/db.py in __init__(self=<webnotes.db.Database instance>, host=None, user=None, password=None, ac_name=None, use_default=0)
     51                 self.password = password or webnotes.get_db_password(self.user)
     52                                 
=>   53                 self.connect()
     54                 if self.user != 'root':
     55                         self.use(self.user)
self = <webnotes.db.Database instance>, self.connect = <bound method Database.connect of <webnotes.db.Database instance>>
 /var/www/erpnext/lib/webnotes/db.py in connect(self=<webnotes.db.Database instance>)
     62                       Connect to a database
     63                 """
=>   64                 self._conn = MySQLdb.connect(user=self.user, host=self.host, passwd=self.password, use_unicode=True, charset='utf8')
     65                 self._conn.converter[246]=float
     66                 self._cursor = self._conn.cursor()
self = <webnotes.db.Database instance>, self._conn undefined, global MySQLdb = <module 'MySQLdb' from '/usr/lib/python2.7/dist-packages/MySQLdb/__init__.pyc'>, MySQLdb.connect = <function Connect>, user undefined, self.user = 'rigpl', host undefined, self.host = u'localhost', passwd undefined, self.password = 'erpnext', use_unicode undefined, builtin True = True, charset undefined
 /usr/lib/python2.7/dist-packages/MySQLdb/__init__.py in Connect(*args=(), **kwargs={'charset': u'utf8', 'host': u'localhost', 'passwd': 'erpnext', 'use_unicode': True, 'user': 'rigpl'})
     79     """Factory function for connections.Connection."""
     80     from connections import Connection
=>   81     return Connection(*args, **kwargs)
     82 
     83 connect = Connection = Connect
Connection = <class 'MySQLdb.connections.Connection'>, args = (), kwargs = {'charset': u'utf8', 'host': u'localhost', 'passwd': 'erpnext', 'use_unicode': True, 'user': 'rigpl'}
 /usr/lib/python2.7/dist-packages/MySQLdb/connections.py in __init__(self=<_mysql.connection closed at 91cf97c>, *args=(), **kwargs={'charset': u'utf8', 'host': u'localhost', 'passwd': 'erpnext', 'use_unicode': True, 'user': 'rigpl'})
    185         kwargs2['client_flag'] = client_flag
    186 
=>  187         super(Connection, self).__init__(*args, **kwargs2)
    188 
    189         self.encoders = dict([ (k, v) for k, v in conv.items()
builtin super = <type 'super'>, global Connection = <class 'MySQLdb.connections.Connection'>, self = <_mysql.connection closed at 91cf97c>, ).__init__ = <bound method Connection.__init__ of <_mysql.connection closed at 91cf97c>>, args = (), kwargs2 = {'client_flag': 196608, 'conv': {0: <class 'decimal.Decimal'>, 1: <type 'int'>, 2: <type 'int'>, 3: <type 'long'>, 4: <type 'float'>, 5: <type 'float'>, 7: <function mysql_timestamp_converter>, 8: <type 'long'>, 9: <type 'int'>, 10: <function Date_or_None>, ...}, 'host': u'localhost', 'passwd': 'erpnext', 'user': 'rigpl'}

<class '_mysql_exceptions.OperationalError'>: (1045, "Access denied for user 'rigpl'@'localhost' (using password: YES)")
      args = (1045, "Access denied for user 'rigpl'@'localhost' (using password: YES)")
      message = ''

an...@iwebnotes.com

unread,
Dec 19, 2012, 12:23:32 AM12/19/12
to erpnext-dev...@googlegroups.com
Hi Aditya,

These are the steps you are supposed to follow when restoring database:

Go to your erpnext installation folder.

1. Edit conf.py
db_name = "your_db_name"
db_password = "your_desired_password"

2. Download your backup and use gunzip to decompress the database backup.

3. Restore your database
lib/wnf.py --install your_db_name path_to_unzipped_backup

The install command will set your database password as specified in the conf.py file.
Since you are changing the password after the restore, it wont work, as the database password set in mysql is still the one that was previously in the conf.py file.

I think this should clarify the process.

4. Run update, patch and sync
lib/wnf.py --update origin master

Thanks,
Anand.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/ZFX2DSvEZDAJ.

Aditya Duggal

unread,
Dec 19, 2012, 12:45:48 AM12/19/12
to erpnext-dev...@googlegroups.com
Hi Anand,

I just would like to tell you that I am not intending to change the password, the only thing I want is to access the online DB on the test account.

Now I have tried to follow the steps enlisted by you below but still I am getting the same error when I log into localhost:8080, surely there is something that I am not doing but nothing that is not listed below.

So I guess the master (that is you) would need to let me know another step which we are missing.

Rushabh Mehta

unread,
Dec 19, 2012, 12:47:54 AM12/19/12
to erpnext-dev...@googlegroups.com
Aditya,

The issue clearly is that the password in your database and conf.py are not matching - Maybe you want to import one more time? (also are you updating the right conf.py - the one in the main folder is the one to update).

- Rushabh


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

To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/67I8j4qtK80J.

Aditya Duggal

unread,
Dec 19, 2012, 2:03:13 AM12/19/12
to erpnext-dev...@googlegroups.com
I think the problem is that since I have downloaded a backup from the online account the password in the DB is something which is not know to me. So the solution could be that you send me the password for the DB via email if there is any password.

Anand Doshi

unread,
Dec 19, 2012, 2:14:43 AM12/19/12
to ERPNext Developer's Forum

Hi Aditya,

The backup file is db password agnostic. It doesn't need the db password to restore. Just follow these steps I mentioned again and it should work.

This is how we restore our databases in our local system. You might've skipped a step.

Try following the exact sequence of steps. Make sure that before you restore your db, you specify the db_name and db_password in the conf.py file.

Thanks,
Anand.

To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/5OrxBaq7eCwJ.

Rushabh Mehta

unread,
Dec 19, 2012, 2:15:07 AM12/19/12
to erpnext-dev...@googlegroups.com
Aditya,

The db does not store its own passwords (but it does store the user password - hashed)

- Rushabh


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

To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/5OrxBaq7eCwJ.

Aditya Duggal

unread,
Dec 19, 2012, 10:32:27 AM12/19/12
to erpnext-dev...@googlegroups.com
Really this is making me pull my hair out. Let me just let u know what I am doing, which btw is same as what you had told me.

I am able to login to the default account that I had setup when I first logged into localhost:8080, now whenver I change the conf.py to erpnext as DB and password as erpnext there is no error on the localhost:8080 but as soon as I change the DB name to rigpl and password to my desired one and try to login then there is that error from my previous post.

I have also change the name of the DB and set my password and ran the process of importing the DB to the system and still I am unable to access the system at localhost:8080

I somehow feel that this error is something which is getting overlooked

<class '_mysql_exceptions.ProgrammingError'>: (1146, "Table 'test123.tabWeb Cache' doesn't exist")
      args = (1146, "Table 'test123.tabWeb Cache' doesn't exist")
      message = ''

Any more help on this would be greatly appreciated.

Anand Doshi

unread,
Dec 19, 2012, 11:11:46 AM12/19/12
to ERPNext Developer's Forum

Hi aditya,

This is a different error and hence you have made progress.

Try running:
lib/wnf.py --update origin master
lib/wnf.py --clear_web

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.

Aditya Duggal

unread,
Dec 19, 2012, 10:36:15 PM12/19/12
to erpnext-dev...@googlegroups.com
Thanks alot finally I have the update on my test machine
To unsubscribe from this group, send email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages