1. Home
  2. Docs
  3. MRF
  4. Installation
  5. Migration

Migration

Migration: From 4.X to 4.3

  • TABLE storage_metas, COLUMN value: Change type from TEXT to LONGTEXT.


Migration: From 4.3 to 5.X

  • Update Prerequisites:
sudo pip install oletools pdfminer
  • Upgrade Usercake:
CREATE TABLE IF NOT EXISTS `uc_sessions` (
 `sessionStart` int(11) NOT NULL,
 `sessionData` text NOT NULL,
 `sessionID` varchar(255) NOT NULL,
 PRIMARY KEY (`sessionID`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
INSERT INTO `uc_configuration` (`id`, `name`, `value`) VALUES 
 (9, 'remember_me_length', '1wk');
  • Run installer (to create new schema), by restoring the “install” folder then navigate to the root
  • Run migration: (Execute these queries)
INSERT INTO samples (md5, filename, threat, size, date, uploader, sha256) 
SELECT md5, filename, vendor as threat, filesize as size, timestamp as date, user as uploader, 
(SELECT value from storage_metas m WHERE m.name = '_sha256' AND m.md5 = s.md5) as sha256 
FROM storage s;
 
INSERT INTO samples_cuckoo (md5, scan_id, status) 
SELECT md5, cuckoo_id as scan_id, is_cuckoo_scanned as status
FROM storage;
 
INSERT INTO samples_metas (md5, comment) 
SELECT md5,
(SELECT value from storage_metas m WHERE m.name = '_comment' AND m.md5 = s.md5) as comment
FROM storage s;
 
INSERT INTO samples_mime (md5, data) 
SELECT md5,
(SELECT value from storage_metas m WHERE m.name = '_mime' AND m.md5 = s.md5) as data
FROM storage s;
 
INSERT INTO samples_ssdeep (md5, data) 
SELECT md5,
(SELECT value from storage_metas m WHERE m.name = '_ssdeep' AND m.md5 = s.md5) as data
FROM storage s;
 
INSERT INTO samples_favorite (md5, user) 
SELECT md5, value as user
FROM storage_metas WHERE name = '_favorite';
 
INSERT INTO samples_pedata (md5, data, icon) 
SELECT md5,
(SELECT value from storage_metas m WHERE m.name = '_pedata' AND m.md5 = s.md5) as data, 
(SELECT value from storage_metas m WHERE m.name = '_icon' AND m.md5 = s.md5) as icon
FROM storage s;s
 
INSERT INTO samples_tag (md5, tag) 
SELECT md5, value as tag from storage_metas m WHERE m.name = '_tag';
 
INSERT INTO samples_url (md5, name, url) 
SELECT md5, 
SUBSTRING_INDEX(SUBSTRING_INDEX(value, '|', 1), '|', -1) as name,
SUBSTRING_INDEX(SUBSTRING_INDEX(value, '|', 2), '|', -1) as url 
FROM storage_metas m 
WHERE m.name = '_url';
 
INSERT INTO samples_virustotal (md5, link, scan_id, score, status) 
SELECT md5, vtlink as link, vt_scan_id as scan_id, vtscore as score, is_vtscanned as status
FROM storage;
  • Modify Cron script location (from /src/cron.php to /cron.php)
  • Remove old tables: samples, samples_metas (when you are sure the migration is complete)


Migration: From 5.0 to 5.1

  • Install peepdf
pip install peepdf


Migration: From 5.1 to 6.0

  • Upgrade Usercake:
INSERT INTO `uc_permissions` (`id`, `name`) VALUES 
 (9, 'Yed Uploader');
  • In samples_metas table: remove “comment” column (data loss)
  • In samples_cuckoo table: add “score” column (TEXT)
  • In samples_pedata table: add “company”, “product”, “version” columns (TEXT)
  • Run /install (or /rename_me_to_install)
  • Run storage migrator at /src/tools/storage_segment.php


Migration: From 6.0 to 6.1

  • In samples table: add “processed” column (int, default value: 1)
  • In samples_metas table: add “downloads_count” column (int, default value: 0)
  • If you use the Cron: add analysis_cron.php to cron table, a good value would be every 5 mns


Migration: From 6.1 to 6.2 and From 6.2 to 7.0

How can we help?