Upgrade from playSMS 1.0-rc8 or 1.0-rc9 to 1.0

Below content is copy-pasted from playSMS Book Project with slight modification to accommodate upgrade from 1.0-rc8 as well.

We have 8 steps to follow to successfully upgrade an installed unmodified playSMS version 1.0-rc8 or 1.0-rc9 to 1.0.

Follow them correctly and in order.

  1. Stop current playSMS daemon

    playsmsd stop
    playsmsd check
    
  2. Backup everything related to installed playSMS 1.0-rc8 or 1.0-rc9

    Backup playSMS database:

    • playSMS DB as SQL file, example DB name is playsms:

      mysqldump -u root -p --add-drop-table playsms > playsms.sql
      

      Note that option --add-drop-table above is important, do not miss it.

    Backup playSMS files and folders:

    • playSMS daemon script at /usr/local/bin/playsmsd
    • playSMS daemon config at /etc/playsmsd
    • playSMS files at web folder /var/www/playsms

    WARNING:

    • Backup process is very important
    • Do not continue if you have any hesitation
    • Ask a lot if you have doubt
    • You must make sure that you know how to restore them
  3. Install playSMS version 1.0 in the same server with the same DB and the same web folder

    playSMS version 1.0 installation manual is available from this topic.

    This step requires you to install playSMS version 1.0 on top of installed playSMS 1.0-rc8 or 1.0-rc9, that means old database, files and folders will be replaced with the new one.

  4. Stop playSMS daemon

    playsmsd stop
    playsmsd check
    
  5. Re-insert your backup playSMS DB sql file (DB sql file dump from previous installation) to the same DB

    mysql -uroot -p playsms < playsms.sql
    
  6. Upgrade DB. Below commands are example for upgrade from playSMS version 1.0-rc8

    wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/db/playsms-upgrade_1.0-rc8_to_1.0.sql
    mysql -uroot -p playsms < ./playsms-upgrade_1.0-rc8_to_1.0.sql
    

    Change 1.0-rc8 to 1.0-rc9 on above commands for upgrade from playSMS version 1.0-rc9

  7. Start playSMS daemon

    playsmsd start
    playsmsd check
    
  8. Verify installation after upgrade

1 Like

Hello,

Trying to upgrade from playSMS 1.0-rc8 to 1.0 using this how-to, I faced an issue. In fact, on step 6 where I had to upgrade DB, I executed the command : mysql -uroot -p playsms < ./playsms-upgrade_1.0-rc8_to_1.0.sql and got the following error : ERROR 1091 (42000) at line 14: Can’t DROP ‘uid’; check that column/key exists.

edit ./playsms-upgrade_1.0-rc8_to_1.0.sql and remove line 14, re-insert again

if still error comment here again

1 Like

Hi, when i open the file line 14 it’s actually a carriage return line. Would you please specify what tells that line?

line 14 is not carriage return, remove from top until that line (including that line removed)

browse this file see on github, its not carriage return:

remember, remove from top of the file until that line, not just that line, then re-insert

anton

Hi, sorry it’s not clear yet. I removed all the content up to the line 14 and now when i run:

mysql -uroot -p playsms < playsms-upgrade_1.0-rc9_to_1.0.sql

Then get this:

ERROR 1091 (42000) at line 1: Can’t DROP ‘mobile’; check that column/key exists

The file i modified looks like this:

cat playsms-upgrade_1.0-rc9_to_1.0.sql

DROP INDEX mobile ON playsms_featurePhonebook ;
DROP INDEX uid_mobile ON playsms_featurePhonebook ;

DROP INDEX uid ON playsms_featurePhonebook_group ;
DROP INDEX flag_sender ON playsms_featurePhonebook_group ;
DROP INDEX code ON playsms_featurePhonebook_group ;

DROP INDEX pid ON playsms_featurePhonebook_group_contacts ;
DROP INDEX gpid ON playsms_featurePhonebook_group_contacts ;

CREATE INDEX pid ON playsms_featurePhonebook_group_contacts (pid) ;
CREATE INDEX gpid ON playsms_featurePhonebook_group_contacts (gpid) ;

CREATE INDEX uid on playsms_tblSMSOutgoing (uid);
CREATE INDEX in_uid on playsms_tblSMSIncoming (in_uid);
CREATE INDEX in_uid on playsms_tblSMSInbox (in_uid);

ALTER TABLE playsms_tblSMSOutgoing_queue ADD queue_count INT(11) NOT NULL DEFAULT ‘0’ AFTER flag;

yes, that is expected

so now you need to remove again from top until that offending line then re-insert again

anton

Thanks. Im doing it now but it keeps trowing the same error for the first line. If i keep doing what im doing i will remove all the content of the script. Im nor sure if what i am doing is right.

It’s working now. Thanks.

Here’s the final file for those going from 1.0-rc9 to 1.0:

DROP INDEX pid ON playsms_featurePhonebook_group_contacts ;
DROP INDEX gpid ON playsms_featurePhonebook_group_contacts ;

CREATE INDEX pid ON playsms_featurePhonebook_group_contacts (pid) ;
CREATE INDEX gpid ON playsms_featurePhonebook_group_contacts (gpid) ;

CREATE INDEX uid on playsms_tblSMSOutgoing (uid);
CREATE INDEX in_uid on playsms_tblSMSIncoming (in_uid);
CREATE INDEX in_uid on playsms_tblSMSInbox (in_uid);

ALTER TABLE playsms_tblSMSOutgoing_queue ADD queue_count INT(11) NOT NULL DEFAULT ‘0’ AFTER flag;

rc9 should have those missing INDEX, but maybe in your installation they’re not exists
this issue is because I couldn’t add something like DROP INDEX IF EXISTS

ref: http://stackoverflow.com/a/2579029/3072936