• Hi,
    Is any info will store in the DB for Makes Path Relative Plugin? The question here is as part of DB export settings enabled on the target environment are resetting and all the options are unchecked and site url is blank. How to keep settings remain intact on the target machine for this plugin after DB export? Please advise.
    Thanks,
    Rajendra

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @rajendrapopuri05

    Yes, plugin stores the value in DB in options table. If you are not exporting the options table that’s may cause on the target machine.

    If you like so, you can add the filter by which all the settings are enabled once the plugin is activated.

    Let me know if you have any further query.

    Thanks,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,
    Thanks for prompt response.
    As part of DB deployment I am exporting the entire wordpress db to target environment. Also, before exporting DB my shell script will replace the source hostname and port with target environment hostname and port. However settings enabled before db deployment are disabled and site URL becomes blank on the target environment. As you said enable filter, Can you please provide more details on that.

    Thanks,
    Rajendra

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @rajendrapopuri05 Thanks for providing some details.

    Add this filter in your theme functions.php.
    add_filter( 'make_paths_relative_activate_all', '__return_true' );

    Also, try to run this query in your target environment and provide the result of the query.
    SELECT * FROM wp_options WHERE option_name = "make_paths_relative"

    Let me know, Does the filter works for you or not.

    Thanks,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami, No luck.

    Here is the query output.

    select * from wp_options where option_name=’make_paths_relative’;

    | option_id | option_name | option_value | autoload |

    | 431 | make_paths_relative | s:322:”a:9:{s:8:”site_url”;s:41:”https://<hostname&gt;:<port>”;s:15:”post_permalinks”;s:2:”on”;s:15:”page_permalinks”;s:2:”on”;s:18:”archive_permalinks”;s:2:”on”;s:17:”author_permalinks”;s:2:”on”;s:19:”category_permalinks”;s:2:”on”;s:11:”scripts_src”;s:2:”on”;s:10:”styles_src”;s:2:”on”;s:11:”image_paths”;s:2:”on”;}”; | yes |

    Note: I have replaced the hostname and port values in the output.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi Rajendra,

    Make the site_url empty and then try it again. Maybe, site_url causing this issue otherwise, everything looks fine to me in the query and the things should work as is supposed to be.

    Thanks,
    Sami

    • This reply was modified 6 years, 2 months ago by Sami Ahmed Siddiqui. Reason: correcting sentence
    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    If I make the site_url to blank, my blog will not work as the blog content is generating with relative URL’s with no context root (‘blog’ is context root in my case). Also, as per the plugin documentation site_url is the default URL in db which doesn’t help. Hence I provided the site_url as https://<hostname&gt;:<port> with no forward slash after port, which is working for me. However, plugin settings are reset after db export. Please advise.

    Thanks,
    Rajendra

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @rajendrapopuri05 Plugin settings doesn’t looks reset as per your provided query result.

    Query result contains the output which allows plugin to take an action as per your desired settings. So, not sure what’s the cause of this issue on migrating DB.

    Regards,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    hmmm. Settings enabled on the WP console are not appearing after DB export due to this the content is not generating relative URL’s. This has to be fixed other site may broken after DB deployment.

    Thanks,
    Rajendra

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    I found the issue now, the values are resetting due to an field in the DB. Here is the SQL query output before and after DB deployment.

    
    select * from wp_options where option_name='make_paths_relative';
    
    | option_id | option_name         | option_value                                                                                                                                                                                                                                                                                                                                 | autoload |
    
    |       431 | make_paths_relative | s:323:"a:9:{s:8:"site_url";s:42:"https://<hostname>:<port>";s:15:"post_permalinks";s:2:"on";s:15:"page_permalinks";s:2:"on";s:18:"archive_permalinks";s:2:"on";s:17:"author_permalinks";s:2:"on";s:19:"category_permalinks";s:2:"on";s:11:"scripts_src";s:2:"on";s:10:"styles_src";s:2:"on";s:11:"image_paths";s:2:"on";}"; | yes      |
    =========================================================================================
    select * from wp_options where option_name='make_paths_relative';
    
    | option_id | option_name         | option_value                                                                                                                                                                                                                                                                                                                                 | autoload |
    
    |       431 | make_paths_relative | s:322:"a:9:{s:8:"site_url";s:41:"https://https://<hostname>:<port>";s:15:"post_permalinks";s:2:"on";s:15:"page_permalinks";s:2:"on";s:18:"archive_permalinks";s:2:"on";s:17:"author_permalinks";s:2:"on";s:19:"category_permalinks";s:2:"on";s:11:"scripts_src";s:2:"on";s:10:"styles_src";s:2:"on";s:11:"image_paths";s:2:"on";}"; | yes      |
    

    See the s:41 and s:42 values before the URL. I noticed that it is a unique key as per table definition. Please advise, is this causing the issue? If so how to overcome this?

    Thanks,
    Rajendra

    • This reply was modified 6 years, 2 months ago by Jan Dembowski. Reason: Fixed formatting
    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi Rajendra,

    s:41 and s:42 doesn’t have the issue. Issue is that the site_url contains https:// twice in your second query.
    https://https://<hostname&gt;:<port>

    Please correct this and use the site url with single https and check does it works for you or not.

    Thanks,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    It was a typo. Originally there was no duplicate protocol in the SQL query result.
    Here is the latest update. Since the plugin details are storing in DB, need to replace the source environment site_url by the target environment site_url. I have updated my shell script to replace the site_url by the target environment site_url, and loading the dump file into target environment DB. Now I see the settings are disabled, and the Site Address is blank in the target environment WP console. I tried by not replacing the site_url in the source DB dump file, site_url and the settings are enabled in the source environment are remain intact on the target environment too. That means if my shell script replace the source environment site_url by the target environment site_url settings are not enabling and site_url field is blank on the target environment after DB export. Also, here is the SQL query result.

    Before DB Deployment
    ====================
    | 431 | make_paths_relative | s:313:”a:9:{s:8:”site_url”;s:32:”http://<hostname&gt;:<port>”;s:15:”post_permalinks”;s:2:”on”;s:15:”page_permalinks”;s:2:”on”;s:18:”archive_permalinks”;s:2:”on”;s:17:”author_permalinks”;s:2:”on”;s:19:”category_permalinks”;s:2:”on”;s:11:”scripts_src”;s:2:”on”;s:10:”styles_src”;s:2:”on”;s:11:”image_paths”;s:2:”on”;}”; | yes |
    After DB Deployment:
    ====================
    | 431 | make_paths_relative | s:313:”a:9:{s:8:”site_url”;s:32:”https://<hostname&gt;:<port>”;s:15:”post_permalinks”;s:2:”on”;s:15:”page_permalinks”;s:2:”on”;s:18:”archive_permalinks”;s:2:”on”;s:17:”author_permalinks”;s:2:”on”;s:19:”category_permalinks”;s:2:”on”;s:11:”scripts_src”;s:2:”on”;s:10:”styles_src”;s:2:”on”;s:11:”image_paths”;s:2:”on”;}”; | yes |
    Suppose if Manually update the site_url and enabled settings after the DB deployment the query result is as below.

    431 | make_paths_relative | s:322:”a:9:{s:8:”site_url”;s:41:”https://<hostname&gt;:<port>”;s:15:”post_permalinks”;s:2:”on”;s:15:”page_permalinks”;s:2:”on”;s:18:”archive_permalinks”;s:2:”on”;s:17:”author_permalinks”;s:2:”on”;s:19:”category_permalinks”;s:2:”on”;s:11:”scripts_src”;s:2:”on”;s:10:”styles_src”;s:2:”on”;s:11:”image_paths”;s:2:”on”;}”; | yes

    Note: The settings I chosen in the source environment are just enabled all the check boxes (Make Permalinks Relative, Make Scripts and Styles Relative, Make Image Paths Relative) and provided site_url as http://<hostname&gt;:<port>.
    2) In my case the source environment is running with no ssl where as the target environment is running with https, so my shell script will replace the protocol while processing the dump file.

    Please let me know if you need anymore details. Thanks in advance for your support.

    Rajendra

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,
    Any suggestions to retain the settings in the target environment after WP Deployment that were enabled in the source environment?

    In my case the deployment consists of DB export and copy/rsync wp-content folder from source environment to the target environment.

    Please advise.

    Thanks,
    Rajendra

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    Actually the blog which I am working on is not in the public domain.
    I am working for an organization, setting up WP environments for a project. I am facing this issue only with lower (Dev, test, and stage) environments. I don’t see any issue with prod servers after DB export, and content deployment to them. I am really not sure what was the issue with lower environments, but it is true that the setting enabled in the source environments are not appearing in the target environments (dev>>test>>stage). Please let me know if anything else I need to check.

    Thanks,
    Rajendra

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    wp

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    I could see the below information after uninstalling this plugin in WordPress DB. Please advise, how to clear this information from DB.

    {s:43:\”make-paths-relative/make-paths-relative.php

    Since the settings enabled on GUI are not persistent after DB export from one machine to another, just wanted to try do a cleanup the plugin details in DB if any and planning to try with a fresh installation of this plugin on source and destination machines. Please advise.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Make Paths Relative – DB Export’ is closed to new replies.