Eric, I am migrating to new hardware. I use a virtual machine running
the new OS as a test bed for each of the programs I am migrating. So,
starting over again is a 10 minute job. Stop the virtual machine, delete
the virtual machine file, copy the saved virtual machine file over and
restart the virtual machine. I then run this script (script7.sh) as root
on the virtual machine. Scripts1-6 are for other apps that I have
already tested on a virtual machine. When I get all of the scripts
running, I'll install a clean OS on the new hardware and run all of the
scripts.
Points of clarification
* "/home/wbostore/backup/wbointi7/stage/" is on the storage server and
contains the necessary data from the old server, as well as, new
required data for the new server.
* The soft references are for convenience (ln -s
/var/lib/pgsql/9.5/data/ /var/lib/pgsql/data)
* To work around getting the DB users from the 1.3.30 DB to work in
1.5.3 i changed the "peer" to "trust" (local all
all trust)
Any other changes are accidental and may be my problem. Thanks for
looking into this.
_______________________________________________
#!/bin/bash
NAME="wvointi7"
OS="CentOS_7"
LOADALL=1
#
# set up SMB Ledger- Postgres 9.5 service and Pass key
#
if [ 1 -eq $LOADALL ] ; then
cat > /etc/yum.repos.d/pgdg-95-centos.repo <<EOF
[pgdg95]
name=PostgreSQL 9.5 \$releasever - \$basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-\$releasever-\$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-95
[pgdg95-source]
name=PostgreSQL 9.5 \$releasever - \$basearch - Source
failovermethod=priority
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/9.5/redhat/rhel-\$releasever-\$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-95
EOF
cat > /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-95 <<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)
mQGiBEeD8koRBACC1VBRsUwGr9gxFFRho9kZpdRUjBJoPhkeOTvp9LzkdAQMFngr
BFi6N0ov1kCX7LLwBmDG+JPR7N+XcH9YR1coSHpLVg+JNy2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pptNQHl
u7euIdIujFwwcxyQGfee6BG+3zaNSEHMVQMuc6bxuvYmgM9r7aki/b0YMfjJBk8v
OJ3Eh1vDH/woJi2iJ13vQ21ot+1JP3fMd6NPR8/qEeDnmVXu7QAtlkmSKI9Rdnjz
FFSUJrQPHnKsH4V4uvAM+njwYD+VFiwlBPTKNeL8cdBb4tPN2cdVJzoAp57wkZAN
VA2tKxNsTJKBi8wukaLWX8+yPHiWCNWItvyB4WCEp/rZKG4A868NM5sZQMAabpLd
l4fTiGu68OYgK9qUPZvhEAL2C1jPDVHPkLm+ZsD+90Pe66w9vB00cxXuHLzm8Pad
GaCXCY8h3xi6VIhJBBgRAgAJBQJHg/JKAhsMAAoJEB8W0uFELfD4K4cAoJ4yug8y
1U0cZEiF5W25HDzMTtaDAKCaM1m3Cbd+AZ0NGWNg/VvIX9MsPA==
=au6K
-----END PGP PUBLIC KEY BLOCK-----
EOF
#
# get the necessary perl modules
#
yum -y remove perl-DBD-Pg
yum -y install perl-CGI-Emulate-PSGI perl-CGI-Simple perl-Config-IniFiles
yum -y install perl-DBI perl-DateTime perl-DateTime-Format-Strptime
yum -y install perl-Digest-MD5 perl-File-MimeInfo perl-JSON-XS perl-starman
yum -y install perl-Locale-Maketext perl-App-cpanminus perl-YAML
yum -y install perl-Log-Log4perl perl-MIME-Lite perl-Math-BigInt-GMP
yum -y install perl-Moose perl-Number-Format perl-Plack
perl-Template-Toolkit
yum -y install perl-namespace-autoclean perl-MooseX-NonMoose perl-XML-Simple
cpan install CPAN
cpan install App::Info
cpan install Locale::Maketext::Lexicon
cpan install MIME::Base64
cpan install CGI::Simple
cpan install DBD::Pg
#
# set up postgres
#
yum -y remove postgresql
rm /var/lib/pgsql/data -Rf
yum -y install postgresql95-server postgresql95-devel postgresql95-libs
ln -s /var/lib/pgsql/9.5/data/ /var/lib/pgsql/data
/usr/pgsql-9.5/bin/postgresql95-setup initdb
export POSTGRES_HOME=/usr/pgsql-9.5
cat > /var/lib/pgsql/data/pg_hba.conf <<EOF
local all postgres peer
local all all trust
host all postgres 127.0.0.1/32 reject
host all postgres ::1/128 reject
host postgres,template0,template1 lsmb_dbadmin 127.0.0.1/32 md5
host postgres,template0,template1 lsmb_dbadmin ::1/128 md5
host postgres,template0,template1 all 127.0.0.1/32 reject
host postgres,template0,template1 all ::1/128 reject
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
EOF
systemctl restart postgresql-9.5.service
cd /var/lib/pgsql/data
su postgres <<EOF
psql -f /home/wbostore/backup/wbointi7/stage/psqldump postgres
EOF
systemctl restart postgresql-9.5.service
#
# Install ledgersmb
#
cd /opt
cp /home/wbostore/backup/wbointi7/stage/ledgersmb-1.5.3.tar.gz /opt/
tar -xzf ledgersmb-1.5.3.tar.gz
rm -f *.gz
cd /opt/ledgersmb
cpanm --quiet --notest --with-feature=starman --installdeps .
ln -s /usr/local/bin/starman /usr/bin/starman
cp /opt/ledgersmb/conf/systemd/* /usr/lib/systemd/system/
cp /opt/ledgersmb/conf/ledgersmb.conf.default /opt/ledgersmb/ledgersmb.conf
chown root:root /opt/ledgersmb -Rf
sed -i 's/=WORKING_DIR/=\/opt\/ledgersmb/'
/usr/lib/systemd/system/starman-ledgersmb.service
sed -i 's/=WORKING_DIR/=\/opt\/ledgersmb/'
/usr/lib/systemd/system/plack-fcgi-ledgersmb.service
useradd -d /non-existent -r -U -c "LedgerSMB/Starman service system
user" ledgersmb
systemctl enable plack-fcgi-ledgersmb.service
systemctl enable starman-ledgersmb.service
systemctl start starman-ledgersmb.service
fi
Regards,
Bill Ott
Home: 919-363-0031
Cell: 919-434-7589
Email: Mailto:bill...@theotts.org
Website: http://www.theotts.org
Profile: http://www.linkedin.com/in/wbott
On 02/27/2017 04:27 PM, Erik Huelsmann wrote:
Hi Bill,
On Mon, Feb 27, 2017 at 8:27 PM, bill Ott <bill...@theotts.org
<mailto:bill...@theotts.org>> wrote:
Hi, Erik. Apparently I am not migrating this properly. The version
from the SQl select command was 1.3.30.
I moved the database by doing "pg_dumpall -c > dumpdata" from the
1.3.30 system but using the pg_dumpall program from the 1.5.3
system. I then issued "psql -f dumpdata postgres" on the 1.5.3
system. Then logging into the 1.5.3 system with psql and
executing a "\l" shows all of the databases. BUT, the version
field from default is 1.3.30
Ok. That explains at least some of it. Which instructions have you
been using for your migration? Can you provide some details as to how
you handled each of the steps in the instructions? Having that
information will help me understand where you're currently at with
your migration.
Very odd the every select I tried on the database works correctly
even though the version is the old version.
Right. You made an exact copy of your database. Which means that all
queries should work as they did under 1.3.
How should I proceed? Can I just use SQl to modify the version
field, or would that just be making things worse?
Just changing the number through an SQL statement will not help to
resolve the situation: the new software won't know it's talking to an
old database version, leaving them in Babylon.
--
Bye,
Erik.
http://efficito.com <http://efficito.com/> -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ledger-smb-users mailing list
Ledger-smb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ledger-smb-users mailing list
Ledger-smb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users