hi Gurus !
I 'm trying to install ERP locally , i have downloaded the virtual machine from erpnext.com/download imported in virtual box … now try to restore by .sql file taken from cloud . but getting following error …
erpnext@erpnext-vm:~/frappe-bench$ bench frappe --restore yh2hwev8eelhxa7o /home/test/database.sql -f
Traceback (most recent call last):
File “/home/erpnext/frappe-bench/env/bin/frappe”, line 5, in
from pkg_resources import load_entry_point
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py”, line 2701, in
parse_requirements(requires), Environment()
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py”, line 572, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: frappe==4.0.0
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 5.5.40-MariaDB-1~wheezy-log mariadb.org binary distribution
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| erpnext |
| mysql |
| performance_schema |
±-------------------+
4 rows in set (0.02 sec)
MariaDB [(none)]>
pkg_resources.DistributionNotFound: frappe==4.0.0 , I think this is the major problem … please help !
But I don’t see any data new DB added
MariaDB [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| erpnext |
| mysql |
| performance_schema |
±-------------------+
4 rows in set (0.02 sec)
and even when I see from front end application there is nothing in it. Please suggest.
which seem to have populated the tables… I 'm not sure what impact will it have on the front end application
For few minutes I could see the front end of the application showing new records and same like as on cloud
but now for web access http://192.168.1.215:8080/desk#
I 'm getting internal server error. Help required …
Thanks for the help … The first command worked and updates pulled. but rest of the two commands restore and migrate are not supported by bench. The difference I can see now after update the front end in web browser is giving 502 Bad gateway not "internal server error. http://192.168.1.215:8080/desk#
erpnext@erpnext-vm:~/frappe-bench$ bench restore /home/test/database.sql
Usage: bench [OPTIONS] COMMAND [ARGS]…
Error: No such command “restore”.
Commands:
backup backup site
backup-all-sites backup all sites
config change bench configuration
get-app clone an app from the internet and set it up…
init Create a new bench
migrate-3to4 Migrate from ERPNext v3.x
new-app start a new app
new-site Create a new site in the bench
patch
prime-wheel-cache Update wheel cache
release Release app (internal to the Frappe team)
restart Restart supervisor processes
retry-upgrade
set-default-site Set default site for bench
set-mariadb-host Set MariaDB host for bench
set-nginx-port Set nginx port for site
set-ssl-certificate Set ssl certificate path for site
set-ssl-key Set ssl certificate private key path for site
set-url-root Set url root for site
setup Setup bench
shell
start Start Frappe development processes
switch-to-develop Switch frappe and erpnext to develop branch
switch-to-master Switch frappe and erpnext to master branch
switch-to-v4 Switch frappe and erpnext to v4 branch
update Update bench
Switched to master
Please run bench update --patch to be safe from any differences in database schema
erpnext@erpnext-vm:~$ bench restore /home/test/database.sql
Usage: bench [OPTIONS] COMMAND [ARGS]…
Error: No such command “restore”.
erpnext@erpnext-vm:~$ bench restore /home/test/database.sql
Usage: bench [OPTIONS] COMMAND [ARGS]…
Error: No such command “restore”.
erpnext@erpnext-vm:~$ bench migrate
Usage: bench [OPTIONS] COMMAND [ARGS]…
Error: No such command “migrate”.
erpnext@erpnext-vm:~$
@shah Below is my 2 cents from what I have picked up along the way. No expert this worked for me.
Make sure that your existing cloud version is running the latest version of Frappe and ERPNext.
V5 has been updated to use MariaDB v10.x instead of MariaDB v5.5
Download a fresh new V5 VM and mount.
Run bench update until local VM is running the latest V5
Log into local ERPNext instance and use the setup wizard to create a (nearly) empty fresh V5 install.
SSH into the local MariaDB using a MySQL client and make a duplicate of your newly created ERPNext DB as a backup. So something like 1bd3e0294d_copy
Delete all tables within your local ERPNext DB but don’t delete the DB.
Import your existing .sql file into your local DB
Copy all of your exsisting image/pdf files etc from your cloud hosted instance: erpnext/sites/mysitename/public/files/
into your local VM instance directory:
erpnext/sites/mysitename/public/files/
When you login via web browser to your local ERPNext instance you should now see your previous ERPNext instance up and running. Your username and password will be the same as your old ERPNext instance.
This can be done more eloquently via bench commands but the guide above is pretty bullet proof.