Updating: CDbException CDbConnection failed to open the DB connection error

I am trying to update Mailwizz 1.3.6.5 and have received the above error.

As far as I can tell the permissions are okay, but maybe I' am missing something.
 
I see it when I run the "update" command. I should note that when I first tried to run the update command after loading the content (through transmit ftp upload), I received another error indicating the system couldn't find a path. The final folder in the path, "runtime" didn't appear in the folder directory, so I created a new folder with that name, and assigned it 777 permissions. Because of previous disasters in trying to update the software, I'm being extra cautious. Thankfully the daily backup process looks like it is working okay.
 

twisted1919

Administrator
Staff member
I received another error indicating the system couldn't find a path. The final folder in the path, "runtime" didn't appear in the folder directory, so I created a new folder with that name, and assigned it 777 permissions.
Transmit will replace the folders, will not override them, so that might be your issue now, the fact your install isn't complete anymore.
I uploaded once via transmit, and the way it works is that it actually removes the existing folders then it uploads from your computer.

Can you look in apps/common/config folder, do you have a main-custom.php file ?
If you don't, then it means transmit simply broken your uploads.
 
This is what I have. I don't see the main-custom.php file.
Can you suggest the best specific steps to take? (I am being very careful as all previous efforts to update have resulted in crashes/rebuilds and last time I was saved only by combining backup and additional offshore services to reload the database by ssh, which is beyond my own capacity.

update-mailwizz.jpg
 

twisted1919

Administrator
Staff member
If the main-custom file is missing then it means this is exactly what happened, transmit simply deleted all your existing files then it uploaded only the ones from the update folder. This is wrong since the files from the update folder should override the ones from your server.

Anyway, let's try this, create a file main-custom.php in apps/common/config with following contents:
PHP:
<?php defined('MW_PATH') || exit('No direct script access allowed');
/**
 * Custom application main configuration file
 * 
 * This file can be used to overload config/components/etc
 * 
 * @package MailWizz EMA
 * @author Serban George Cristian <cristian.serban@mailwizz.com> 
 * @link http://www.mailwizz.com/
 * @copyright 2013-2014 MailWizz EMA (http://www.mailwizz.com)
 * @license http://www.mailwizz.com/license/
 * @since 1.1
 */
   
return array(
    // application components
    'components' => array(
        'db' => array(
            'connectionString'  => 'mysql:host=localhost;dbname={DB_NAME}',
            'username'          => '{DB_USER}',
            'password'          => '{DB_PASS}',
            'tablePrefix'       => '{DB_PREFIX}',
        ),
    ),
);
Replace the placeholders with your own data, then save the file and try again. This time the database connection should work and the app will just complain about some missing folders that you'll manually add as you'll be prompted.
 
I have set the config file as requested, and followed the process of adding the missing folders based on the prompt. Now I am getting (when running the 'update') the 503 error Application currently offline. Try again later! I notice on the "latest" version I can log into the backend but the front end gives me the 503 error.

Further note:

In checking the backend I found the setting as "offline". When I switched it to "online" I got this message when I tried to run the update program:

Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
 
Last edited:

frm.mwz

Well-Known Member
I have set the config file as requested, and followed the process of adding the missing folders based on the prompt. Now I am getting (when running the 'update') the 503 error Application currently offline. Try again later! I notice on the "latest" version I can log into the backend but the front end gives me the 503 error.

Further note:

In checking the backend I found the setting as "offline". When I switched it to "online" I got this message when I tried to run the update program:

Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

try to set
long system urls
 
I'm not sure how the last answer helps as I can't see anything with "long system URLs" anywhere on CPanel or within my controls. If there are files I should include in the folder (that may have been deleted with the transmit update), I can add them, but want to be careful to do this right to avoid a system hang in the middle of the update process. As it is, the process aborted before it could do any damage to the (non-updated) program running process, so I'm still using the previous version. My caution is based on experience. In three of three previous updates I ended up with major crash/rebuilding problems that essentially required me to restart from scratch. (Fortunately, I had backup for the data, but it still was an ordeal to make things right.)
 

frm.mwz

Well-Known Member
I'm not sure how the last answer helps as I can't see anything with "long system URLs" anywhere on CPanel or within my controls. If there are files I should include in the folder (that may have been deleted with the transmit update), I can add them, but want to be careful to do this right to avoid a system hang in the middle of the update process. As it is, the process aborted before it could do any damage to the (non-updated) program running process, so I'm still using the previous version. My caution is based on experience. In three of three previous updates I ended up with major crash/rebuilding problems that essentially required me to restart from scratch. (Fortunately, I had backup for the data, but it still was an ordeal to make things right.)

settings -> common
clean URLs: no

then regenerate sys URLs in
settings -> system URLs
 
Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

No change in the circumstances. This is the message I get when I try to run the update.
 

frm.mwz

Well-Known Member
Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

No change in the circumstances. This is the message I get when I try to run the update.


iron-over ALL files from the update folder (ideally directly with the file manager of your control panel, as ftp sometimes creates problems)

then update from command line
 
"Iron over" -- what does that mean?
If the updating process requires playing around with command line prompts, it is over my head. I'm not a programmer or trained systems administrator (though everyone around me comes to me for technical advice because I seem to be ahead of the curve for a lay person.)

I will need to assign this task to a consultant but am not sure if I have the clear instructions I need to provide to set up the assignment -- especially if the individual doesn't have experience with this program.

So far I am batting zero for three in updating Mailwizz -- with much hassle and rebuilding -- and emergency management as the program was offline (first time, without proper backup, what a mess!)

If someone is available for a fee to do this, please advise. Otherwise, I will need very clear instructions (they can be quite technical if needed) to set up the qualifications/invitation to quote the job.
 
Twisted 1919: Where should this Index file be? There is one in the "update" folder.

In the "latest" folder I see another folder "backend" and then the directory with several folders and files (including another "backend) folder, and the index file:
construction-marketing.org/mailwizz/latest/backend -- this is what I see:

If there is to be an index file that is either not there or in the wrong place, what should it contain?

baackend-files.jpg
 

twisted1919

Administrator
Staff member
@Publisher1953 - If you look on your server using FTP, does the /backend folder contains a index.php file ?
Anyway, let's try this:
1. download latest version of mailwizz on your desktop and unzip it.
2. Connect to your ftp and via ftp create a folder named newsletter at same level with the mailwizz folder, so basically you will be able to access it like: construction-marketing.org/newsletter
3. From your desktop, open the unzipped mailwizz folder, then go into the latest folder. Copy all that folder contents via FTP into your newsletter folder.
4. Point your browser to construction-marketing.org/newsletter/install and complete the install process, but make sure you use a new database. The old database will be used a bit later.
5. Login in the backend of the app.
6. Via FTP, open the file newsletter/apps/common/config/main-custom.php and change the database name into the old database name. You might need to change the username and password as well. If you need to, do it.
7. Go back to your browser and refresh it. This time, you should be prompted to update the application.
8. Follow the update instructions. Highly recommended to do the update from command line.
9. After the update completes, you should have a fully functional mailwizz application with your old data in it.
10. if everything fine, you can safely remove the old application files, otherwise post here.

Give it a try and let me know how it goes.
Thanks.
 
Thanks, it worked! I was fearful about the need for command line instructions, but it turned out the standard process worked okay and all the files are properly in place, along with the mass of stored data.

Hopefully next update will be smoother now that I have a better understanding of the processes.
 
Top