Difference between revisions of "Importing DB Seed Manually"

From iDempiere en
(initial)
 
Tag: visualeditor
 
(35 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
<!-- breadcrumb -->
 +
<font size=-2>
 +
&lArr;
 +
[[Installing_iDempiere|Table of Contents]] |
 +
[[Setting up Eclipse]] |
 +
Importing DB Seed Manually |
 +
[[Configuring iDempiere within Eclipse]]
 +
&rArr;
 +
</font>
 +
 
Please note this procedure is intended for technical people wanting to configure iDempiere to run in Eclipse, there is an easier mechanism on the installers to create the database.
 
Please note this procedure is intended for technical people wanting to configure iDempiere to run in Eclipse, there is an easier mechanism on the installers to create the database.
  
 
Let's check the steps to create an idempiere postgres database:
 
Let's check the steps to create an idempiere postgres database:
  
== Create adempiere user ==
+
== Set a password for the postgres user ==
  
 
  sudo su - postgres
 
  sudo su - postgres
  psql -U postgres -c "CREATE ROLE adempiere SUPERUSER LOGIN PASSWORD 'adempiere'"
+
  psql -U postgres -c "ALTER USER postgres PASSWORD 'TheSystemPassword'"
logout
+
  exit
 
 
'''WARNING:''' Of course this is an insecure password, it is recommended that you set up a proper password for this user account
 
 
 
== Create the idempiere database ==
 
 
 
createdb  --template=template0 -E UNICODE -O adempiere -U adempiere idempiere
 
psql -d idempiere -U adempiere -c "ALTER ROLE adempiere SET search_path TO adempiere, pg_catalog"
 
 
 
When asked the password please provide the adempiere password that you set up in the previous step.
 
 
 
'''NOTE:''' It is possible that you will confront problems related to pg_hba.conf configuration, it's beyond of the scope of this tutorial to solve those problems at this moment, please check and configure proper permissions. Also, this tutorial is intended to work on a postgres installed locally, if your postgres is elsewhere you must use corresponding -h (host) and -p (port) parameters for createdb and psql.
 
 
 
== Import the seed ==
 
 
 
cd /tmp
 
jar xvf $IDEMPIERE_REPOSITORY/org.adempiere.server-feature/data/seed/Adempiere_pg.jar
 
psql -d idempiere -U adempiere -f Adempiere_pg.dmp
 
 
 
You must replace $IDEMPIERE_REPOSITORY with the folder of your cloned repository.
 
  
== Applying additional migration scripts ==
+
'''WARNING:''' Of course this is an insecure password, it is recommended that you set up a proper password for this user account.  You need this password for the instructions below
  
You can check the latest applied migration script on that seed with this command:
+
== Run console-setup-alt.sh to initialize the parameters ==
  
  cat $IDEMPIERE_REPOSITORY/org.adempiere.server-feature/data/seed/LAST_SCRIPT_APPLIED_ON_THIS_SEED
+
  cd $HOME/sources/idempiere/org.idempiere.p2/target/products/org.adempiere.server.product/linux/gtk/x86_64
 +
bash console-setup-alt.sh
 +
# answer all questions from this program, you can choose here database name, etc, take care of the two passwords:
 +
  Database Password [adempiere]:
 +
    answer this question with your desired password for the adempiere user
 +
  Database System User Password []:
 +
    TheSystemPassword  <- answer this question with the password you set on the previous step
 +
# at the end the program must have generated two files, move them:
 +
mv idempiere.properties .idpass $HOME/sources/idempiere
  
Again, replace $IDEMPIERE_REPOSITORY with the folder of your cloned repository.
+
== Import the database ==
 +
cd $HOME/sources/idempiere
 +
bash RUN_ImportIdempiereDev.sh
  
Now, you must check if there are new migration scripts after the last applied, you can check the migration scripts this way:
+
The last command must import the database and apply all the migration scripts.
  
ls $IDEMPIERE_REPOSITORY/migration/360lts-release/postgresql
 
  
If you find there are unapplied migration scripts then you can apply them with:
 
  
psql -d idempiere -U adempiere -f $IDEMPIERE_REPOSITORY/migration/360lts-release/postgresql/810_ProbableFutureMigrationScript.sql
+
'''NOTE:''' See [[Talk:Importing_DB_Seed_Manually|Discussion]] tab for additional notes.
  
Please check carefully the output of the migration scripts, if you find errors please ask for help on the [http://groups.google.com/group/idempiere support forums]
 
  
You must repeat the previous for each unapplied migration scripts, it's recommended also to take note of the last applied for future reference.
+
''This How-To is brought to you by [[User:CarlosRuiz|Carlos Ruiz]] from [https://www.bx-service.com/ BX Service GmbH].  Feel free to improve directly or suggest using the Discussion tab.
  
At the end you can run the post-migration processes like this:
+
[[Category:User Manual|I]]
 +
[[Category:Installation|E]]
 +
[[Category:Installation Eclipse]]
 +
[[Category:Development‏‎]]
 +
[[Category:Developer documentation‏‎]]
 +
[[Category:HowTo]]
 +
[[Category:Updated2022]]
  
cat $IDEMPIERE_REPOSITORY/migration/processes_post_migration/postgresql/*.sql | psql -d idempiere -U adempiere
+
<!-- breadcrumb -->
 +
<font size=-2>
 +
&lArr;
 +
[[Installing_iDempiere|Table of Contents]] |
 +
[[Setting up Eclipse]] |
 +
Importing DB Seed Manually |
 +
[[Configuring iDempiere within Eclipse]]
 +
&rArr;
 +
</font>

Latest revision as of 14:35, 17 October 2025

Table of Contents | Setting up Eclipse | Importing DB Seed Manually | Configuring iDempiere within Eclipse

Please note this procedure is intended for technical people wanting to configure iDempiere to run in Eclipse, there is an easier mechanism on the installers to create the database.

Let's check the steps to create an idempiere postgres database:

Set a password for the postgres user

sudo su - postgres
psql -U postgres -c "ALTER USER postgres PASSWORD 'TheSystemPassword'"
exit

WARNING: Of course this is an insecure password, it is recommended that you set up a proper password for this user account. You need this password for the instructions below

Run console-setup-alt.sh to initialize the parameters

cd $HOME/sources/idempiere/org.idempiere.p2/target/products/org.adempiere.server.product/linux/gtk/x86_64
bash console-setup-alt.sh
# answer all questions from this program, you can choose here database name, etc, take care of the two passwords:
  Database Password [adempiere]:
    answer this question with your desired password for the adempiere user
  Database System User Password []:
    TheSystemPassword  <- answer this question with the password you set on the previous step
# at the end the program must have generated two files, move them:
mv idempiere.properties .idpass $HOME/sources/idempiere

Import the database

cd $HOME/sources/idempiere
bash RUN_ImportIdempiereDev.sh

The last command must import the database and apply all the migration scripts.


NOTE: See Discussion tab for additional notes.


This How-To is brought to you by Carlos Ruiz from BX Service GmbH. Feel free to improve directly or suggest using the Discussion tab.

Table of Contents | Setting up Eclipse | Importing DB Seed Manually | Configuring iDempiere within Eclipse

Cookies help us deliver our services. By using our services, you agree to our use of cookies.