Skip to content

Instantly share code, notes, and snippets.

View mgarces's full-sized avatar
🎧

Marco Garcês mgarces

🎧
View GitHub Profile
Prerequisite
One instance of Alfresco on mysql, one postgresl of exactly the same version (schema version).
Step 1. Dump database
mysqldump --port 3306 -u alfresco --password=alfresco -h 127.0.0.1 --databases alfresco --skip-comments --skip-extended-insert --no-create-db --hex-blob --default-character-set=utf8 --skip-triggers --compact --no-create-info --skip-quote-names --compatible=postgresql > mydump.sql
Step 2. Dump local Postgres schema
You can install a clean version of Alfresco to use as for schema dump
(need to insert command for dump here)
@mgarces
mgarces / gist:9915424
Last active March 14, 2024 15:13
Steps I took to migrate my Alfresco 3.4d on MariaDB 5.5 to Alfresco 4.0d Postgres 9.3
# Marco Garcês - mgarces at sysadmin dot pt
# 2014
# These are the steps I took to migrate an Alfresco 3.4d community, running on top of MariaDB 5.5.35-1
# to Alfresco 4.0d on PostgreSQL 9.3.4 [CentOS release 6.5 (Final)]
#
# Prerequisites:
# You need the original MySQL Database (I used a cloned virtual machine of my original server), 2 empty Postgres databases, with # name alfresco and alfresco40, with owner alfresco, password alfresco.
# I have also used the soon-to-be opensource tool, DBTransfer (https://github.com/mgarces/dbtransfer) to move the data from
# MySQL to PostgreSQL.
#
CREATE OR REPLACE FUNCTION "reset_sequence" (tablename text, columnname text, sequence_name text) RETURNS "pg_catalog"."void" AS
$body$
DECLARE
BEGIN
EXECUTE 'SELECT setval( ''' || sequence_name || ''', ' || '(SELECT MAX(' || columnname || ') FROM ' || tablename ')';
exception when others then
raise notice 'Wrong column name, ignore';
END;
URL_DB_SOURCE = jdbc:mysql://10.2.24.167:3306/alfresco
USER_DB_SOURCE = alfresco
PASSWORD_DB_SOURCE = alfresco
URL_DB_DESTINATION = jdbc:postgresql://10.2.31.23:5432/ECMPRD01_alfresco1
USER_DB_DESTINATION = alfresco
PASSWORD_DB_DESTINATION = alfresco
ONLY_NOT_EMPTY = false
TRANSFER.THREADS = 8
MYSQL.NORMALIZE.BIT_BOOLEAN = true
CONSTRAIN.KEEP_NAMES = true
for n in $(for i in {3..10000} ; do out=$(( $i % 2 )); if [ $out -eq 1 ]; then echo $i ; fi ; done) ; do F=($(factor $n)) ; if [ -z "${F[2]}" ]; then echo $n ; fi ; done
The last packet successfully received from the server was 7,419,456 milliseconds ago. The last packet sent successfully to the server was 9,448,563 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4155)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:926)
@mgarces
mgarces / radosgw-error
Created August 12, 2014 13:36
error message when I access apache - radosgw setup
[Tue Aug 12 12:29:11.888327 2014] [core:error] [pid 6120] [client 10.5.5.222:52943] End of script output before headers: s3gw.fcgi
[Tue Aug 12 12:29:17.037566 2014] [fcgid:warn] [pid 6121] (104)Connection reset by peer: [client 10.5.5.222:52960] mod_fcgid: error reading data from FastCGI server
[Tue Aug 12 12:29:17.037731 2014] [core:error] [pid 6121] [client 10.5.5.222:52960] End of script output before headers: s3gw.fcgi
@mgarces
mgarces / nginx_radosgw
Created August 18, 2014 15:53
Tengine RadosGW config file
server {
listen 80;
server_name *.rados.test rados.test;
client_max_body_size 10g;
# This is the important option that tengine has, but nginx does not
fastcgi_request_buffering off;
location / {
source 'https://rubygems.org'
require 'json'
require 'open-uri'
require 'kramdown'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'font-awesome-sass'
gem 'kramdown'
gem 'github-pages', versions['github-pages']
@mgarces
mgarces / nginx-unificontroller.conf
Created March 18, 2018 01:07 — forked from vidia/nginx-unificontroller.conf
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;