This guide describes how to migrate from Denbun POP V2.0P R4.3(with PostgreSQL version 8.2 ) to Denbun POP V2.0P R4.3(with PostgreSQL version 8.3).
If you use the V2.0P R4.3 or lower, please upgrade it to V2.0P R4.3, and then follow the procedure of this guide.
If your version is Denbun POP V2.0P R4.3 which supports PostgreSQL8.3, you do not have to migrate it.
Note
This guide is written for users who have the knowledge about Linux, Apache HTTP Server, PostgreSQL, etc. Please refer the appropriate documentation for installation and operation of each product.
Since this guide supposes working on Linux, the procedure and screen shot, etc. might be different from customer's environment.
Prerequisites
This migration procedure assumes that the following environments.
- The migration source and destination must be on the same servers.
- Only Denbun database exists on PostgreSQL.
- Denbun and the packages required for Denbun (PostgreSQL, MeCab, MeCab dictionary) are not used by other applications (These packages can be uninstalled).
- There is no access to Denbun (* Scheduler is stopped).
- The current version of Denbun is V2.0P R4.3(for PostgreSQL version 8.2)
- The version of Denbun after migration is V2.0P R4.3(for PostgreSQL version 8.3)
- Denbun and required packages have been installed with the installation guide.
- Denbun is installed in "/var/www/cgi-bin/dnpwml".
|
|
- 1. Preparation (Taking Backup)
-
Please backup the following data before conversion.
It assumes that the data is backed up to "/tmp" directory.
- Backup the database
- Backup the users' photo
1-1. Backup the database
Backup the current database which needs migrating.
Use the following command to back up the database.
You have to be the user "postgres" to backup the data.
$ su – postgres
# /usr/local/pgsql/bin/pg_dump -b -Fc dnpwmldb > /tmp/dnpwmldb82.pgdmp
|
1-2. Backup the users' photo
If you register users' photo using Management - User List - Add (Edit) User, please back up the directory for the photos.
You have to be the user "root" to backup the data.
$ su -
Password:
# cp –rp /var/www/cgi-bin/dnpwml/dnpwmlfile /tmp/
|
- 2. Uninstall Denbun for PostgreSQL version 8.2
-
Please refer this guide for uninstall Denbun for PostgreSQL version 8.2.
Uninstall PostgreSQL8.2, MeCab, MeCab dictionary.
You have to be the user "postgres" to uninstall it.
Use the following command to switch to the root user.
Please use the following command to stop PostgreSQL before uninstall.
# /etc/rc.d/init.d/postgresql stop
|
2-1. Uninstall pgmecab
Use the following command to uninstall pgmecab.
# cd /usr/local/src/pgmecab-1.1/
# gmake uninstall
.
. (Omitted)
.
# cd ../
# \rm -r pgmecab-1.1/
|
2-2. Uninstall MeCab dictionary
Use the following command to uninstall MeCab dictionary.
# cd /usr/local/src/mecab-ipadic-2.7.0-20070801/
# gmake uninstall
.
. (Omitted)
.
# cd ../
# \rm -r mecab-ipadic-2.7.0-20070801/
|
2-3. Uninstall MeCab
Use the following command to uninstall MeCab.
# \rm /usr/lib/libmecab.so
# \rm /usr/lib/libmecab.so.1
# cd /usr/local/src/mecab-0.96/
# gmake uninstall
.
. (Omitted)
.
# cd ../
# \rm -r mecab-0.96/
|
2-4. Uninstall TSearch2
Use the following command to uninstall TSearch2.
# cd /usr/local/src/postgresql-8.2.4/contrib/tsearch2/
# gmake uninstall
|
2-5. Uninstall PostgreSQL8.2
Use the following command to reset the automatic startup setting of PostgreSQL8.
# chkconfig --del postgresql
# \rm /etc/rc.d/init.d/postgresql
|
Then, uninstall PostgreSQL8.2.
# cd /usr/local/src/postgresql-8.2.4/
# gmake uninstall
.
. (Omitted)
.
# cd ../
# \rm –r postgresql-8.2.4/
|
Delete database directory.
2-6. Delete postgres user
Use the following command to delete the postgres user.
# /usr/sbin/userdel -r postgres
|
2-7. Reset Apache settings
Configure the directives in Apache configuration file (httpd.conf). The configuration file is included in "/etc/httpd/conf" directory if the Apache is packaged in a Redhat Enterprise Linux. Use an editor such as vi to edit the file.
Remove the following SetEnv directives.
#Denbun POP, PostgreSQL Library PATH
SetEnv LD_LIBRARY_PATH /usr/local/pgsql/lib:/var/www/cgi-bin/dnpwml/lib
|
Make sure the configuration and then restart Apache.
# /etc/rc.d/init.d/httpd configtest
Syntax OK
# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Stopping httpd: [ OK ]
|
- 3. Install Denbun for PostgreSQL version 8.3
-
Please install Denbun POP V2.0P R4.3 which supports PostgreSQL8.3.
To install Denbun, please refer this guide.
[ Download] Denbun POP V2.0P R4.3 for PostgreSQL version 8.3
- 4. Data migration
-
Migrate the data you back up the procedure 1. to the data for Denbun POP for PostgreSQL version 8.3.
Please upload the file ( dnpwmlshifttoolpg83.zip) required for the restoring the data, and expand it under "/tmp" directory. A directory named "dnpwmlshifttool" is created.
4-1. Migrate the database
Execute the following command before restoring the data you created at the procedure 1.1.
You have to be the user "postgres" to execute the command.
$ su – postgres
# /usr/local/pgsql/bin/psql –d dnpwmldb –U dnpwml < /tmp/dnpwmlshifttool/pre.sql
|
Then, restore the data you created at the procedure 1.1.
# /usr/local/pgsql/bin/pg_restore –a -U postgres -Fc -d dnpwmldb < /tmp/dnpwmldb82.pgdmp
|
* The following errors are displayed when restoring. Please ignore them because the errors occured due to there is no table for "tsearch2" for PostgreSQL8.2 in PostgreSQL8.3.
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2119; 0 180605 TABLE DATA pg_ts_cfg postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "pg_ts_cfg" does not exist
Command was:
COPY pg_ts_cfg (ts_name, prs_name, locale) FROM stdin;
pg_restore: [archiver (db)] Error from TOC entry 2120; 0 180610 TABLE DATA pg_ts_cfgmap postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "pg_ts_cfgmap" does not exist
Command was: COPY pg_ts_cfgmap (ts_name, tok_alias, dict_name) FROM stdin;
pg_restore: [archiver (db)] Error from TOC entry 2121; 0 180615 TABLE DATA pg_ts_dict postgres
pg_restore: [archiver (db)] could not execute query: ERROR: column "dict_name"
of relation "pg_ts_dict" does not exist
Command was: COPY pg_ts_dict (dict_name, dict_init, dict_initoption, dict_lexize, dict_comment) FROM stdin;
pg_restore: [archiver (db)] Error from TOC entry 2122; 0 180620 TABLE DATA pg_ts_parser postgres
pg_restore: [archiver (db)] could not execute query: ERROR: column "prs_name" of relation "pg_ts_parser" does not exist
Command was: COPY pg_ts_parser (prs_name, prs_start, prs_nexttoken, prs_end, prs_headline, prs_lextype, prs_comment) FROM stdin;
WARNING: errors ignored on restore: 4
|
Execute the following command after restoring.
# /usr/local/pgsql/bin/psql –d dnpwmldb –U dnpwml < /tmp/dnpwmlshifttool/after.sql
|
Please delete unnecessary files at the end. You have to be "root" user to execute the command.
$ su -
Password:
# \rm –r /tmp/dnpwmlshifttool
# \rm /tmp/dnpwmldb82.pgdmp
|
4-2. Move the Photo directory
Move the directory you created at the procedure 1-2. to directory "/var/www/cgi-bin/dnpwml".
To move the directory, execute the following command.
$ su
Password:
# mv /tmp/dnpwmlfile /var/www/cgi-bin/dnpwml/
|
- 5. Complete migration
-
The migration from Denbun POP for PostgreSQL version 8.2 to Denbun POP for PostgreSQL version 8.3 completed.
|