Mysql DB server OS change / replacement or distro upgrade; study case

Mysql DB server OS change:

MySQL Oracle

MySQL Oracle

Mysql DB server OS change might be required in different situations, but for those who do not know what I am talking about, let me start by explaining what this is and why you might need it in some situations. Just to serve as an example; let say you are renting a few Virtial Machine Server from X IDC or cloud provider. This cloud provider gave you an a distribution that in 2013 had 4 years of support and everything was cool, you installed you systems. Now is 2017 and you need an upgrade. Let me give more details.

You are running a web environment with load balancers, web-server, and 2- Mysql DB servers Master and slave replication, etc. Your application needs High availability and you can not afford to have a lot of downtime. Your system is running fine, but last month you got a notification that the EOL (End of life) of your distribution is in 2 months. You also you noticed that your Percona MySQL DB 5.5 has a few limitations that you want to resolve by upgrading toPercona MySQL DB 5.6 or 5.7. So this is the perfect opportunity to upgrade the system and not remain with a legacy OS that will lose support soon. So now you know all you need to know and you are decided to go with progress and make a difference with the change.

MySQL: MariaDB community logo

MySQL: MariaDB community logo

You contact your provider about upgrading your system. They reply with a link (URL) to their FAQ saying that they do not support system upgrade. Then you start reading about it and notice that many virtualization services providers do not really support the upgrade. So you can not just du apt-get dist-upgrade. Not that you can not try, but you will likely not succeed, own experience here long ago when I was young and stupid. Maybe your provider supports it, but you might have grown fond of some other distribution over time and you want to change let say from Debian to Redhat or vise-versa, change of company policy, etc. So reason for wanting to change are many. Continue reading

recursive python; copy files, directories and set ownership

Hi, today I want to post a small script to copy files and directories and add a specific owner to a folder. I did this script myself and I am fairly new to python, about 6 months of experience. If you think it should be changed or has issues, please let me know so I can improve it.
To achieve my objective I have used a few standard libraries that come already with any major python distribution (`os`, `shutil`, `pwd`, `grp`; I will talk about those in a bit more details afterwards). Then I created a function `copy_files`. This function can receive the source files path, the destination, owner and space, this parameters are used to copy the files set owner and show the results. In this function I use recursion as this is a classic recursion problem, I will come back to this further on this post. The last part of the script checks is the destination exists actually calls copy_files function. This is the code: Continue reading