• Resolved DavidWSnow

    (@davidwsnow)


    My plugin relies on an SQL function that has been added to the MySQL database.
    When I “migrate” the WP installation from my localhost to my hosting provider this function gets lost during the process. UpdraftPlus should check for all the MySQL bits and pieces in addition to just the tables when it is backing up and restoring.

Viewing 6 replies - 1 through 6 (of 6 total)
  • @davidwsnow

    Can you please explain more in detail about the issue with your Plugin which relies on SQL function and checks that requires UpdraftPlus to take care of?

    Thanks,
    Harshad

    Thread Starter DavidWSnow

    (@davidwsnow)

    My plugin looks in MySQL tables added to the WP database and looks for Adult Family Homes nearest to the target area the customer is interested. I have a MySQL function that takes the target lat/long and returns the rows of AFHs within a specific great-circle radius. When I use UpdraftPlus to migrate my site from my localhost to a hosting provider the table gets there but the function does not.

    Plugin Author David Anderson

    (@davidanderson)

    Is this MySQL function attached to a specific database? Can you show us the create statement that created it so that we can look at the issue further?

    Plugin Author David Anderson

    (@davidanderson)

    Also, showing the relevant extract of the output from running mysqldump on the database would be helpful.

    Thread Starter DavidWSnow

    (@davidwsnow)

    It appears to in MySQL Workbench it is nested under the tables, views stored procedures in the functions folder. I can’t create it without have the database name selected and highlighted. An export produces many file but agingsaf_demo4_routines.slq contains:
    — MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)

    — Host: localhost Database: agingsaf_demo4
    — ——————————————————
    — Server version 5.7.23

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE=’+00:00′ */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=’NO_AUTO_VALUE_ON_ZERO’ */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


    — Dumping routines for database ‘agingsaf_demo4’

    /*!50003 DROP FUNCTION IF EXISTS asi_calcDistance */;
    /*!50003 SET @saved_cs_client = @@character_set_client */ ;
    /*!50003 SET @saved_cs_results = @@character_set_results */ ;
    /*!50003 SET @saved_col_connection = @@collation_connection */ ;
    /*!50003 SET character_set_client = utf8 */ ;
    /*!50003 SET character_set_results = utf8 */ ;
    /*!50003 SET collation_connection = utf8_general_ci */ ;
    /*!50003 SET @saved_sql_mode = @@sql_mode */ ;
    /*!50003 SET sql_mode = ‘ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’ */ ;
    DELIMITER ;;
    CREATE DEFINER=root@localhost FUNCTION asi_calcDistance(lat float, lng float, pnt_lat float, pnt_lng float) RETURNS float
    BEGIN

    Declare dist float;
    SET dist =
    3959 * acos (
    cos ( radians(pnt_lat) )
    * cos( radians( lat ) )
    * cos( radians( lng ) – radians(pnt_lng) )
    + sin ( radians(pnt_lat) )
    * sin( radians( lat ) )
    );

    RETURN dist;

    END ;;
    DELIMITER ;
    /*!50003 SET sql_mode = @saved_sql_mode */ ;
    /*!50003 SET character_set_client = @saved_cs_client */ ;
    /*!50003 SET character_set_results = @saved_cs_results */ ;
    /*!50003 SET collation_connection = @saved_col_connection */ ;
    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

    — Dump completed on 2019-05-03 14:51:06

    Plugin Author David Anderson

    (@davidanderson)

    Thank you. Current versions of UpdraftPlus will not back up or restore functions. (This is actually the first time in ~8 years that somebody has requested it). We have added a task to our development roadmap to add this support. (AFAIK we will then be the only backup plugin supporting it).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘MySQL functions not backed up’ is closed to new replies.