Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
28cae9c7
Commit
28cae9c7
authored
Nov 20, 2023
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add step by step script to migrate cagette env to new env
parent
b0a8758e
Pipeline
#3139
failed with stage
in 1 minute 6 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
old-to-new-env-steps.txt
scripts/src/old-to-new-env-steps.txt
+59
-0
No files found.
scripts/src/old-to-new-env-steps.txt
0 → 100644
View file @
28cae9c7
//Ces notes ont été prises lors de la conversion de l\'architecture cagette préprod vers la nouvelle architecture.
//Elles peuvent servir à faire de même sur la prod !
//USERS, HOME DIRS, FILES, RIGHTS
useradd -m odoo
usermod -s /bin/bash odoo
useradd -m django
usermod -s /bin/bash django
cd /home/lacagette
mv Odoo odoo-server.conf odoo-server.log odoo-server.log.1 odoo-server.log.2 scripts .local /home/odoo/.
//un nouveau odoo-server.log a été créé automatiquement, il faudra gérer ça
mv -f third-party cronlogs .virtualenvs /home/django/.
mkdir /home/odoo/cronlogs
cp -r /home/odoo/scripts /home/django/scripts
chown -R odoo:odoo /home/odoo
chown -R django:django /home/django
chown -R django:django /shared_dir/django_static
//PYTHON VENV
cd /home/django/.virtualenvs
rm -rf third-party .gitignore bin lib pyvenv.cfg
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv -p python3.8 -r /home/django/third-party/requirements.txt third-party
//PSQL
//key to understand : "A user is a role with the ability to log in (the role has the LOGIN attribute)."
su postgres
psql
create role odoo login;
grant lacagette to odoo;
alter database lacagette owner to odoo;
select pg_terminate_backend(pid) from pg_stat_activity where pid <> pg_backend_pid() and datname = 'lacagette';
alter database lacagette rename to odoo;
exit
exit
//CONFIGS
sed -i -e 's/\/lacagette\//\/odoo\//g' /home/odoo/odoo-server.conf
sed -i -e 's/db_name = lacagette/db_name = odoo/g' /home/odoo/odoo-server.conf
sed -i -e 's/db_user = lacagette/db_user = odoo/g' /home/odoo/odoo-server.conf
sed -i -e 's/dbfilter = lacagette/dbfilter = odoo/g' /home/odoo/odoo-server.conf
sed -i -e "s/'lacagette'/'odoo'/g" /home/django/third-party/outils/settings_secret.py
sed -i -e 's/lacagette/django/g' /etc/scripts/django.sh
sed -i -e 's/lacagette/django/g' /etc/init.d/django
sed -i -e 's/lacagette/odoo/g' /etc/init.d/odoo
//CRONS
crontab -l -u lacagette | grep -v "sync_files.sh" | crontab -u django -
crontab -l -u lacagette | grep "sync_files.sh" | crontab -u odoo -
crontab -r -u lacagette
//FILESTORE ISSUE
su postgres
psql
\c odoo
delete from ir_attachment where mimetype in ('text/css','application/javascript');
//puis deux restarts nécessaires... de odoo
restart django.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment