這里會(huì)顯示出您選擇的修訂版和當(dāng)前版本之間的差別。
兩側(cè)同時(shí)換到之前的修訂記錄 前一修訂版 后一修訂版 | 前一修訂版 | ||
en:razor:upgrade-instruction-v0-4-to-v0-5 [2015/03/18 11:22] cobub [1、Modify database] |
en:razor:upgrade-instruction-v0-4-to-v0-5 [2017/07/14 11:18] (當(dāng)前版本) |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ~~Title:Cobub Razor Upgrade Instruction (v0.4 to v0.5) - Mobile Apps Marketing Platform of Open Source - Mobile Analytics & Mobile Push Notification Solutions - Cobub Mobile Developer Center~~ | ||
+ | {{description>Cobub Razor is an Open Source Mobile Analytics. When you are ready to upgrade Cobub Razor from version 0.4 to version 0.5, following steps is required:.}} | ||
+ | {{keywords>Cobub Razor,open source mobile analytics,mobile analytics,mobile app analytics, upgrade}} | ||
+ | |||
====== Upgrade Instruction (v0.4 to v0.5) ====== | ====== Upgrade Instruction (v0.4 to v0.5) ====== | ||
When you are ready to upgrade Cobub Razor from version 0.4 to version 0.5, following steps is required: | When you are ready to upgrade Cobub Razor from version 0.4 to version 0.5, following steps is required: | ||
===== Step one: download the code of V0.5 ===== | ===== Step one: download the code of V0.5 ===== | ||
- Download the code of version 0.5 from https://github.com/cobub/razor/releases , and you can get the razor-0.5.zip, unzip it to get razor-0.5 folder, which contains the sdk and web folders. | - Download the code of version 0.5 from https://github.com/cobub/razor/releases , and you can get the razor-0.5.zip, unzip it to get razor-0.5 folder, which contains the sdk and web folders. | ||
- | - Copy the web folder to the directory of your web site where you are ready to upgrade Cobub Razor (Note: web can not be the same name with Cobub Razor’s name of V0.4 ). To facilitate debugging, you can rename “web” to “razor_v5“, and set the $ config ['base_url'] value to the ‘http://192.168.1.103/razor_v5 ‘ in config.php which is under the application folder . | + | - Copy the web folder to the directory of your web site where you are ready to upgrade Cobub Razor (Note: web can not be the same name with Cobub Razor’s name of V0.4 ). To facilitate debugging, you can rename “web” to “razor_v5“, and set the $ config ['base_url'] value to the ‘http://yoururl/razor_v5 ‘ in config.php which is under the application folder . |
- Copy the autoload.php、database.php and routes.php of V0.4 under the directory of application\config\ to the diretory of application\config\ of V0.5, override these three files of V0.5. | - Copy the autoload.php、database.php and routes.php of V0.4 under the directory of application\config\ to the diretory of application\config\ of V0.5, override these three files of V0.5. | ||
===== Step two: modify the script files of database and data warehouse ===== | ===== Step two: modify the script files of database and data warehouse ===== | ||
行 20: | 行 24: | ||
|product_id |int(11) NOT NULL | | | |product_id |int(11) NOT NULL | | | ||
sql: | sql: | ||
- | <code> | + | <code sql> |
create table razor.umsinstall_user2product(id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,user_id int(11) NOT NULL,product_id int(11) NOT NULL);</code> | create table razor.umsinstall_user2product(id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,user_id int(11) NOT NULL,product_id int(11) NOT NULL);</code> | ||
行 96: | 行 100: | ||
Unzip it and change the name of database(razor) to your own database name(v0.4), and the table prefix(umsinstall_ ) to your own database table prefix(v0.4) in SQL script. | Unzip it and change the name of database(razor) to your own database name(v0.4), and the table prefix(umsinstall_ ) to your own database table prefix(v0.4) in SQL script. | ||
+ | |||
+ | ==== 2、Modify data warehose ==== | ||
+ | |||
+ | |||
+ | |||
+ | === 2.1 Modify tables === | ||
+ | |||
+ | |||
+ | == 1) fact_clientdata == | ||
+ | |||
+ | |||
+ | add: | ||
+ | |||
+ | property name: useridentifier, | ||
+ | |||
+ | property value: varchar(256) DEFAULT NULL | ||
+ | |||
+ | sql : | ||
+ | <code>ALTER TABLE `razordw.umsinstall_fact_clientdata` ADD COLUMN `useridentifier` varchar(256) DEFAULT NULL;</code> | ||
+ | |||
+ | |||
+ | === 2.2 Modify the stored procedures === | ||
+ | |||
+ | |||
+ | Stored procedures: **rundim** and **runfact**. | ||
+ | |||
+ | Steps: | ||
+ | |||
+ | 1)Copy the related sqls of **rundim** and **runfact** stored procedures in **datawarestore.sql** under the directory of **assets\sql** of v0.5, respectively. Store them and rename **rumdim.sql** and **runfact.sql**. | ||
+ | |||
+ | 2)Modify the table prefix (Cobub Razor ‘s default table prefix is umsinstall_) | ||
+ | |||
+ | Modify the **umsinstall_** in **rundim.sql** and **runfact.sql** above to your own data warehouse’s table prefix, for example,your data warehouse table prefix “razordw_”; | ||
+ | |||
+ | Replace the “**databaseprefix.umsdatainstall_**” to “database.database’s table prefix”, for example, your database is **cobubrazor**,and database’s table prefix is **razor**_,the “**databaseprefix.umsdatainstall_**” should be “**cobubrazor.razor**_“. | ||
+ | ===== Step three: stop inserting data to database and pause the stored procedures. ===== | ||
+ | |||
+ | |||
+ | Note: you need to have prepared all the relevant SQL scripts(i.e. all sql scripts in Step two). | ||
+ | |||
+ | |||
+ | ===== Step four: delete the stored procedures (rundim and runfact) in data warehouse. ===== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Step five: execute the SQL scripts generated in Step two. ===== | ||
+ | |||
+ | |||
+ | Note: Please backup the data of your database and data warehouse before you execute the sql scripts. | ||
+ | |||
+ | |||
+ | ===== Step six:restart the database and data warehouse. ===== | ||
+ | |||
+ | Before this step, you need to do the last thing : | ||
+ | |||
+ | Backup the directory of the previous web site(e.g **web**,which is the root directory of version 0.4),store it in a suitable place and named web-backup0.4, then delete **web**. | ||
+ | |||
+ | Change”**razor_v5**” to “**web**”(the name of V0.4),and set $config['base_url']= ‘http://yoururl/web’ in **config.php**. | ||
+ | |||
+ | Annex 1: user_permissionsv0.5 | ||
+ | |||