PG::ConnectionBad upgrade to Yosemite and postgresql 9.4.4
Basically, I had to drop and recreate my own database and re-seed it with remote staging data. What I did not understand is that the problem with updating a database is that the data itself also needs to be 'updated' in a way. The data was compatible with a different version
Setup Symfony2 and Postgresql on OS X 10.10 Yosemite?
Can you show us your /app/config/config.yml ? please
Did you change the dbal connection value ?
# Doctrine Configuration
doctrine:
dbal:
default_connection: pgsql
connections:
#Postgresql
pgsql:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
Mysql won't start after upgrading Mac OS X Yosemite (Mac OS 10.10)
I haven't yet updated to Yosemite yet but I had this link saved when I do:
Get Apache, MySQL, PHP and phpMyAdmin working on OSX 10.10 Yosemite
This specific line may do some good:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
But check the whole post and let me know if it helps!
Good luck!
Postgres - FATAL: database files are incompatible with server
If you recently upgraded postgres to latest version, you can run the below command to upgrade your postgres data directory retaining all data:
brew postgresql-upgrade-database
The above command is taken from the output of brew info postgres
Note: this won't work for upgrading from 14 to 15 as of recent testing.
How to upgrade postgresql database from 10 to 12 without losing data for openproject
A) First create a backup of all the databases for that (You can continue from B if you dont need a backup)
- Log in as postgres user
sudo su postgres
- Create a backup .sql file for all the data you have in all the databases
pg_dumpall > backup.sql
B) Upgrade to PostgreSQL12
- update packages and install postgres 12
sudo apt-get update
sudo apt-get install postgresql-12 postgresql-server-dev-12
- Stop the postgresql service
sudo systemctl stop postgresql.service
- migrate the data
/usr/lib/postgresql/12/bin/pg_upgrade \
--old-datadir=/var/lib/postgresql/10/main \
--new-datadir=/var/lib/postgresql/12/main \
--old-bindir=/usr/lib/postgresql/10/bin \
--new-bindir=/usr/lib/postgresql/12/bin \
--old-options '-c config_file=/etc/postgresql/10/main/postgresql.conf' \
--new-options '-c config_file=/etc/postgresql/12/main/postgresql.conf'
- Switch to regular user
exit
- Swap the ports the old and new postgres versions.
#change port to 5432
sudo vim /etc/postgresql/12/main/postgresql.conf
#change port to 5433
sudo vim /etc/postgresql/10/main/postgresql.conf
- Start the postgresql service
sudo systemctl start postgresql.service
- Log in as postgres user
sudo su postgres
- Check your new postgres version
psql -c "SELECT version();"
- Run the generated new cluster script
./analyze_new_cluster.sh
- Return as a normal(default user) user and cleanup up the old version's mess
#uninstalls postgres packages
sudo apt-get remove postgresql-10 postgresql-server-dev-10
#removes the old postgresql directory
sudo rm -rf /etc/postgresql/10/
#login as postgres user
sudo su postgres
#delete the old cluster data
./delete_old_cluster.sh
- Congrads! Your postgresql version is now upgraded, If everything works well in B, we dont have to apply the backup as we have already migrated the data from the older version to the newer version, the backup is just in case if anything goes wrong.
NOTE: Change the postgresql.conf and pg_hba.conf as per your requirement
PS: Feel free to comment your issues, suggestions or anyother modifications you would like to suggest
Related Topics
Where to Insert Rack::Deflater in the Rack
Rails Nested With_Option :If Used in Validation
Omniauth Facebook Expired Token Error
How to Save a Timezone Correctly with Ruby and Mongoid
Are There Any Good Mutation Testing Tools for Ruby 1.9 and Rspec2
Ruby - Difference Between :Variable and @Variable
Solving the Travelling Salesman Problem in Ruby (50+ Locations)
Ruby on Rails: Conditionally Display a Partial
Are There Ruby Equivalents to Car, Cdr, and Cons
Create Hash from Array and Frequency
Rake Db:Migration Not Working on Travis-Ci Build
Difference Between String.Scan and String.Split
Invoke Delayed_Job Capistrano Tasks Only on Specific Servers
A Selenium Webdriver Exception
Add_Foreign_Key VS Add_Reference in Rails
Why Does Rails Titlecase Add a Space to a Name
Rails Return JSON Serialized Attribute With_Indifferent_Access