This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add postgres deb sources | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
| # Add GPG key | |
| wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add - | |
| # Update packages & details | |
| sudo apt-get update | |
| # Install postgres | |
| sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 postgresql-contrib-9.6 -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| client = boto3.client('ec2') | |
| paginator = client.get_paginator('describe_volumes') | |
| pages = paginator.paginate() | |
| for page in pages: | |
| for volume in page['Volumes']: | |
| instanceName = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install pre-requisites | |
| sudo apt-get install freetds-common freetds-dev libct4 libsybdb5 | |
| sudo service gitlab stop | |
| # Install postgres and create relevant users | |
| sudo apt-get install -y postgresql postgresql-client libpq-dev postgresql-contrib | |
| # Install pgloader CCL version. This is important since the SBCL version will max out at 4 GB of memory and migration will not complete | |
| curl -sL -o /tmp/pgloader-ccl.sh https://raw.githubusercontent.com/opf/pgloader-ccl/master/buildpack/compile | |
| bash /tmp/pgloader-ccl.sh |