Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Database Restore Help PLEASE

Hi,

long story short, i tried to upgrade to v1.9 and it did not go well, now i have deleted all files and re installed v1.7.2 back again, i would like to know how to restore database,
so i can get my tickets back.

do i still run the setup and point to database ?

Hosting is with hostgator using cpanel
Database was backed up and i have username and password

Many Thanks

Comments

  • PHP Error log entries
    Mail Sending: phpMail being used
    Mail Fetching/Receiving: POP
    PHP version: 5.2
    Operating System: Windows xp sp3

    Hope this helps let me know if you require more information

  • Hi!
    Create the new database in cpanel and restore it using phpmyadmin. Then, copy all the files back to your hosting (the v1.7.2) and edit the /include/ost-config.php to match the database name, username and password.

    Hope it helps!
    C


  • Thanks C4RLOCO for that, i have managed to create new database and restored in cpanel, i have also copied files back using ftp method, i need help with ost-config.php file see extract below where do i put in prefix, localhost, mysql username and password ?
    I am new to this and far from expert but if told should be able to edit file.

    <?php
    /*********************************************************************
        ost-config.php

        Static osTicket configuration file. Mainly useful for mysql login info.
        Created during installation process and shouldn't change even on upgrades.

      
        Copyright (c)  2006-2010 osTicket
        http://www.osticket.com

        Released under the GNU General Public License WITHOUT ANY WARRANTY.
        See LICENSE.TXT for details.

        vim: expandtab sw=4 ts=4 sts=4:
        $Id: $
    **********************************************************************/

    /**
     * If you have a strange HTTP server configuration and osTicket cannot
     * discover the URL path of where your osTicket is installed, define
     * ROOT_PATH here.
     *
     * The ROOT_PATH is the part of the URL used to access your osTicket
     * helpdesk before the '/scp' part and after the hostname. For instance, for
     * http://mycompany.com/support', the ROOT_PATH should be '/support/'
     *
     * ROOT_PATH *must* end with a forward-slash!
     */
    # define('ROOT_PATH', '/support/');

    #Disable direct access.
    if(!strcasecmp(basename($_SERVER['SCRIPT_NAME']),basename(__FILE__)) || !defined('INCLUDE_DIR'))
        die('kwaheri rafiki!');

    #Install flag
    define('OSTINSTALLED',FALSE);
    if(OSTINSTALLED!=TRUE){
        if(!file_exists(ROOT_DIR.'setup/install.php')) die('Error: Contact system admin.'); //Something is really wrong!
        //Invoke the installer.
        header('Location: '.ROOT_PATH.'setup/install.php');
        exit;
    }

    # Encrypt/Decrypt secret key - randomly generated during installation.
    define('SECRET_SALT','%CONFIG-SIRI');

    #Default admin email. Used only on db connection issues and related alerts.
    define('ADMIN_EMAIL','%ADMIN-EMAIL');

    #Mysql Login info
    define('DBTYPE','mysql');
    define('DBHOST','%CONFIG-DBHOST');
    define('DBNAME','%CONFIG-DBNAME');
    define('DBUSER','%CONFIG-DBUSER');
    define('DBPASS','%CONFIG-DBPASS');

    # SSL Options
    # ---------------------------------------------------
    # SSL options for MySQL can be enabled by adding a certificate allowed by
    # the database server here. To use SSL, you must have a client certificate
    # signed by a CA (certificate authority). You can easily create this
    # yourself with the EasyRSA suite. Give the public CA certificate, and both
    # the public and private parts of your client certificate below.
    #
    # Once configured, you can ask MySQL to require the certificate for
    # connections:
    #
    # > create user osticket;
    # > grant all on osticket.* to osticket require subject '<subject>';
    #
    # More information (to-be) available in doc/security/hardening.md

    # define('DBSSLCA','/path/to/ca.crt');
    # define('DBSSLCERT','/path/to/client.crt');
    # define('DBSSLKEY','/path/to/client.key');

    #Table prefix
    define('TABLE_PREFIX','%CONFIG-PREFIX');

    ?>

  • does anyone have a example with false information or personal details changed or removed so i can copy from ?
  • edited June 2014
    Since you are restoring from a backup, you must use the same ost-config.php file you have backed up. Primary because that file more than likely will have Encrypt/Decrypt secret key that is randomly generated upon the initial installation, plus your database encrypted data would need that key.

    After you have copied your backed up ost-config.php file, you only need to change the following lines:


    #Mysql Login info
    define('DBTYPE','mysql');
    define('DBHOST','localhost');
    define('DBNAME','yourdbname');
    define('DBUSER','yourdbusername');
    define('DBPASS','yourdbpass');

    After these changes, and if the info properly matches your database information created in MySQL (using phpadmin) you should be able see your site online.


    Let me know how that goes.

    Regards,
    C
  • Thanks for help i have managed to get site online
  • You are very welcome! I am glad to hear you are back on your feet. :-)
This discussion has been closed.