How to update Bitnami LAMP stack? - updates

I'm running a few Bitnami LAMP stacks and so far it's been very convenient and most things work as expected.
I've been searching for information on how to update Apache, MySQL, and PHP. They're installed in the /opt/bitnami/ directory and they don't seem to update when I run:
$ sudo apt-get update
How do you update Bitnami LAMP stacks?
Thanks in advance! :)

Bitnami developer here.
Please note that our applications are self-contained and that means that our applications bundle all of the libraries, databases, and runtimes required to run on any platform and they don't depends on the components that exist in your system. The way you tried to update the components doesn't work with the Bitnami stacks due to it updates the components of the system.
You will learn more about Bitnami stacks here.
If you launched a server with LAMPstack in the cloud you could launch a new server with the latest version of the stack and then migrate the data, however if you installed the stack in a local server you could install the new version of the stack and migrate the data before uninstalling the old version.
To migrate the data you will need to copy your custom files from the old version to the new one (The php files of your application if you deployed your custom php application, the configuration files of Apache if you modified it, ...) and the data of the database. To migrate the database you will need to create a backup of your databases
mysqldump -u root -p database_name > backup.sql
And restore it in the new installation
mysql -u root -p database_name < backup.sql
Please note that you will need to create that database if it's not created.
mysql -u root -p
mysql> create database database_name;
mysql> grant all privileges on database_name.* to 'bitnami'#'localhost'
identified by 'BITNAMI_USER_PASSWORD';
mysql> flush privileges;
mysql> exit;
If you also installed any of the modules that we provide you have to install them in the new installation and migrate the data of the applications. The process depends on each application.
I hope it helps.
Jota

We are in 2022 and still no improvement on that aspect. So bad. You can't update. Just build the server from the beginning.

Related

Missing MySQL users after migration using Plesk Migration Tool

so I'm not a server expert. Managed to migrate a server using Plesk's migration tool. All Plesk managed DBs were moved. But discovered that all DBs and users managed through MySQL were not migrated. Can anyone tell me a solution to this?
This is an expected behavior - Plesk Migration Tool will migrate only objects it knows about. Since you have some databases and users which are managed through MySQL directly, Plesk does not know anything about it, so they will not be transferred.
You should transfer such databases and users manually with mysqldump.
To create a backup of database with mysqldump you can use the following command:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME > FILE_NAME.sql
To restore such database run:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin DATABASE_NAME < FILE_NAME.sql
Also you will need the mysql database which contains grant information. I do not recommend you to blindly transfer it and just re-create users.
Keep in mind that if MySQL version on target server is higher than on source you will need to run mysql_upgrade script to make changes in schema.
Alternatively you can export/import databases through phpMyAdmin which is shipped with Plesk and can be found at Plesk > Tools & Settings > Database Servers.

How can I change MariaDB to MySQL in XAMPP?

A. First things first:
Mr. Google hasn't helped me to found any reply to my question
above
Yes, I have read a solution to the opposite question here
How to upgrade MySQL to MariaDB in XAMPP in 5 minutes on Windows
(and it hasn't helped me: MySQL simply doesn't start)
I don't expect replies like 'MariaDB is better, - stop your silly
exercises'.
B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future.
C. Can someone share their experience (if any) in solving this problem?
Running XAMPP with MySQL
Here are exact step by step instructions for truly integrating MySQL into XAMPP on Windows. This has been successfully tested with Windows 10 and XAMPP 7.3.11 for both MySQL 8.0.18 and 5.7.28.
Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel.
Download the MySQL community server as zip archive (Windows 64 bit version)
Rename C:\xampp\mysql to C:\xampp\mariadb
Extract the downloaded zip archive to C:\xampp\mysql. Make sure you extract the folder level which has the subfolders bin, include, lib etc.
Copy C:\xampp\mariadb\bin\my.ini to C:\xampp\mysql\bin
Open C:\xampp\mysql\bin\my.ini in an editor and comment out the line starting with key_buffer= in the [mysqld] section.
Open a command prompt and run the following commands:
For MySQL 8.0.18:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure
start /b bin\mysqld
bin\mysql -u root
CREATE USER pma#localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost;
ALTER USER root#localhost IDENTIFIED WITH mysql_native_password BY '';
ALTER USER pma#localhost IDENTIFIED WITH mysql_native_password BY '';
\q
bin\mysqladmin -u root shutdown
For MySQL 5.7.28:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure --log_syslog=0
start /b bin\mysqld --log_syslog=0
bin\mysql -u root
CREATE USER pma#localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost;
\q
bin\mysqladmin -u root shutdown
Start Apache and MySQL in the XAMPP Control Panel.
Go to http://localhost/phpmyadmin and verify that your database server is now reported as MySQL Community Server.
You can use the following way.
Stop MariaDB in Xampp which show as mysql running...
Download the installer for windows mysql Installer
Follow the instruction.
Now start Apache2 and clear cookie in your browser. Now you can see phpmyadmin and workbench showing Server type: MySQL
If you want to stick to MariaDB then you can use sqlyog also.
Hope it answer your question
You have to do little adjustment with xampp in order to use MySQL instead of MariaDB . I just did following and its worked , i think it may helpful to others also.
Download and install mysql installer.
2.stop xampp and rename the mysql folder inside the xampp directory(may be its not necessary! )
3.just start Apache only from xampp control panel . No need to start mysql.
4.Last step . Make sure your running MySQL in your system . That's it ..
Check php admin panel there you can see Server type: MySQL instead of MariaDB ...
Thanks..
I just upgraded XAMPP because of PHP 7. I am also using mysql workbench. I want to be as close to production as I can, but my webhoster supports only mysql. These where my reasons to switch back from mariadb to mysql
I followed these steps: (also max 5min)
https://gist.github.com/odan/c799417460470c3776ffa8adce57eece

Schema version issue in Icinga 2

I'm installing icinga2 on Debian from:
deb http://debmon.org/debmon debmon-jessie main
deb http://httpredir.debian.org/debian jessie-backports main
As described here:
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/getting-started#setting-up-mysql-db
I run:
apt-get install icinga2-ido-mysql
apt-get install icingaweb2
and it perform self-configuration.
Now, I'm accessing http://localhost/icingaweb2/setup
and on DB configure page it gives me:
The database you've configured to use for Icinga Web 2 seems to be the one >of Icinga. Please be aware that this database configuration is supposed to >be used for Icinga Web 2's configuration and that it is highly recommended >to not mix different schemas in the same database. If this is intentional, >you can skip the validation and ignore this warning. If not, please provide >a different database.
I run DB configuration manually with:
mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
as manual requires, and gives new DB name, and get same error...
In GitHub, in the project's section, in DbResourcePage.php on line 133 the error yields.
Can some one suggest me what can I do?
Try to update the icingaweb2 schema:
mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/icinga_web.sql
Hoping this helps you in.
Cheers

Copying database backup files from xamp/mysql/data of windows to linux in path /var/lib/mysql

Copying database backup files from xamp/mysql/data of windows to linux in path /var/lib/mysql, but it is creating only empty database in phpmyadmin of linux.
Please some one help me to solve this issue, i have only these files backup with me
The best way is-
Step1: Take backup from windows by mysqldump-
mysqldump -uroot -proot123 -A > backup.sql
Step2: Move this backup to linux, you can use winscp tool for it.
Step3: Now restore this backup to linux machine.
mysql -uroot -proot123 < backup.sql
Modification:
It seems your db engine is myisam and you just coppied file/folder from window to linux, so give permissions as per below-
chown -R mysql.mysql /var/lib/mysql
First create a .my.cnf file containing the mysql root password in your users home folder, on linux.
On windows, there exists a .my.ini or something which serves the same purpose. That way you will not have to reenter your passwords a lot during the next steps, which you are very likely to repeat several times until you get them right, I fear. :)
Since unix/linux and windows have different ways to save files, you might very likely run into errors during a simple copy-restore process, depending on how you copy files.
Your best bet is likely copying the original mysql folders to another windows machine and save them accordingly, such that mysql can find them. (With an installed mysql instance, of course.) I don't know what else you might need, if the databases are not found instantly, since I never had to do this prior and have no test setup here to check this case out.
When the databases are found through the mysql on the WINDOWS server, from the mysql cli prompt there look up which encoding etc the db uses:
SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;
Then create a new database on the LINUX server with the same name and the same encoding's from MYSQL CLI:
create database <db-name> character set <charset> collate <collation>;
Then on the WINDOWS server in a CMD window, do a mysqldump which should look familiar on windows like on linux:
mysqldump <db-name> > <db-name>.sql
Then copy the dump over to the LINUX server and replay it:
mysql <db-name> < <db-name>.sql
Afterwards you will have to recreate a user (if you know which user and password your web app used to access the database, create a new user with these credentials and grant him full access on your database.
If you do not happen to know the credentials anymore, create an arbitrary user and then change the database credentials in the configfile of your web application.
In case you have problems, check the unix file permissions of the files you copied, such that mysql can access them.
Good luck, mate.

Magento can't connect MySQL

After someone messed up the server, Magento could not connect MySql DB.
First try, I used mysql -u <username> -h localhost -p and failed to authenticate.
After a lot of struggle this guy helped me (the solution is in the comments), so I finally succeeded connecting to the DB using Magento's credentials. But then I couldn't connect remotely, this one didn't help since --skip-networking disables remote connection, but I finally figured it out as well (now I don't remember what I did, either changed something in my.cnf or /etc/hosts).
So now I can connect with Magento username/password (configured in configuration.php) both locally and remotely.
Still, Magento prints to screen errors that it can't connect MySql.
I checked both local.xml and config.xml (under <Magento root>/app/etc) and both seems to be configured correctly.
I started thinking about installing the whole thing from scratch, the problem is that there isn't any good backup and I'm not sure what/if I'm going to loose data by doing that, but if I'll have to, I'll backup the files+DB and go for it...
Any ideas ?
UPDATE
After endless digging, apparently there were other XML files in the same directory with local.xml and config.xml. Removing these files (which were created as backups, but were left with the .xml extension) the problem was solved.
Conclusion: if you backup xml files, save the backup as file.xml.backup so it won't be treated the same as a file with an xml extension!
If you're thinking about reinstalling the whole thing, may I, as a foreword, advise to do that on a different server than the messed-up one - just in order to keep data on the old one in case things turn bad. You may also want to do that on the same server but with a different vhost, home folder and mysql database.
Here is the procedure I use when making Magento project migrations, imports and other stuff related to Magento moves from one server to another.
This requires that you can access mysql + mysqldump from the shell.
This is a procedure I use regularly on Debian based distros with LAMP.
On source server
1. Clean the BD
This is necessary if you consider that your DB is to heavy to be downloaded from your new destination server.
Also, please make sure that you really know which tables you are truncating. I cannot tell which precisely as this depends on your Magento version.
Roughly, truncate index tables + core_url_rewrite, log tables, cron_schedule, flat catalog tables, dataflow batch tables and profile history, reports aggregation tables.
2. Backup the DB
mysqldump -h [host] -u [user] -p'[password]' [dbname] > magento.sql
3. Clean your Magento filesystem
From you Magento root folder:
rm -rf var/session/* && rm -rf var/cache/* && rm -rf var/log/*
4. Archive your Magento filesystem
From your Magento root folder:
tar -zcvf magento.tar.gz .
On the destination server
Retrieve your magento.sql and magento.tar.gz any way you like (wget, copy/paste from SSH GUI client...) and put them in your new Magento root directory.
5. Import your DB
mysql -h [your_host] -u [user] -p'[password]' [dbname]
That will open the mysql shell on your new DB
mysql> SET FOREIGN_KEY_CHECKS = 0;
mysql> source /full/path/to/magento.sql
...
mysql> SET FOREIGN_KEY_CHECKS = 1;
6. Extract your magento.tar.gz
From your new Magento root directory
tar -zxvf magento.tar.gz
You should now be able to see your site. Some permissions modification and a fine tuning of app/etc/local.xml may be needed to make it fit to your destination server MySql configuration.
Try to flush cache from backend or delete /var/cache/*