Since v3.2, 2Bizbox welcomes “adding
database”, a new function with which you will either be able to shift between
several independent company databases, or set separated databases for your
subsidiaries.
Some import files should be prepared before we create the new
empty database. We can export these files from our current default and test
database.
3. Use command “mysqldump” to export database files “bb2_default” and “bb2_default_sg”. The
command format is:
”mysqldump –uroot –proot –P3307
database_name_you_want_to_export > file_path_you _want_to_export_to”.
Note:
1. Default username is “root” and default password is “root”;
2. Do not forget the database name (***.sql) at the end of the
file path;
3. Pay attention to uppercase, e.g. “uroot”, “P3307”;
4. If your database background runs on other servers, please add “-h
server_name IP_address” after “username” and “password”.
4. Execute command
and find the two sql files we just exported under the export catalog. Please
note that in this step, you must export “bb2_default” and “bb2_default_sg”
together. For test database, export “bb2_test” and “bb2_test_sg” together.
Step Two: create new database
2. Use command “create” to create two
databases: “bb2_***” and “bb2_***_sg”. Command format: “create database database_name
CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';”. Use command “show databases”
if you want to check the new created database.
3. Use command “use” to select database
you need. Command format: “use database_name”. Use command “source” to import
database files. Command format: “source database_file_catalog_you_want_
to_import_to”
4. Repeat the above operation to import
“bb2_***_sg”
After above two operations in database background,
we need to update two fines under 2BizBox catalog to realize this new function.
1. Find file “mysql-ds.xml” under 2BizBox install
path “\2BizBox ERP
3\server\jboss\server\default\deploy” and open it in wordpad.
2. Copy all content about the “default” database
and paste them in front of </datasources>. If you export and import test
database before, then copy and paste content about “test”
3. Replace all “default” (or “test”) with name of
new added database, 4 places in all.
4. Find file “BB2ServerBase.jar” under 2BizBox
install path “\2BizBox ERP 3\server\jboss\server\default\lib” and open it by
RAR or ZIP.
5. Find and open file “Organization.txt” under
catalog “/com/serva/bb2/common” in “BB2ServerBase.jar”.
6. You will see two lines in this txt file. At the
end of each line, please add the name of new added database and save.
7. Find two xml file with “default” (or “test) under
catalog “/com/serva/bb2/access” in “BB2ServerBase.jar”. Drag them out and
rename them by new added database.
8. Open these two xml files by wordpad and replace
three “default” (or “test”) with name of new added database.
9. Repeat above operations to the other XML file in
SG database.
10. Save the above two XML files and drag them back
to “BB2ServerBase.jar”. Since our operation doesn’t work if we keep the two
background windows running, please close background windows during updating
database files.
Open 2BizBox background and
login interface, input name of the new added database and original username and
password. Now we are able to use the new added database.
No comments:
Post a Comment