5 Simple Steps to Move a WordPress Website Between Hosts

Lately I had to move a WordPress website between hosts, and I did almost everything one should NOT do (just for this paper, of course Sourire), before taking a pause to think a little bit, and finally do that transfer properly. So the goal of this post is to have you benefit from my experience, the good as well as the bad. The steps explained here will work in any case. Simply, if you created your site on your own local machine, you will not have to worry about DNS transfert, but everything else is going to be the same.

Move a WordPress website

In my specific case, the move had to be between an Azure website (A site) and a Linux Virtual server (B site), but the steps involved can be applied more generally to any move of a WordPress website, even if A is your own local machine. So we are going to talk about how to move a WordPress website between A and B, A being the point of origin, B the destination.

What NOT to do

Let’s start by what should not be done:

  • Beginning by taking care of DNS Domain Name Transfer!!!
  • To NOT change the “origin” URL in WordPress, while DNS is modified….

The consequence of these 2 actions being simply that one cannot get access to the admin part of the origin website, as the login method still point to the domain name, but the DNS wants to open site B, which does not exists yet! If I had not established an access, with MySQL WorkBench, directly to site A database, I am not sure how I would have been able to get out of the corner in which I painted myself!

What to do

  1. Clean
  2. Pack
  3. Move
  4. Unpack, Install
  5. Change of address

Thanks to computers and plugins, you’ll see all those steps to move WordPress website are much simpler than when it’s about packing your dishes…

Read more ›

Posted in Web, WordPress

Savoir Écrire: Avantage Compétitif?

Savoir Écrire: Avantage Compétitif?

Dans notre monde où la haute technologie prend une place de plus en plus importante, au point que l’apprentissage de la programmation dès la maternelle est une question revenant de manière récurrente, on peut se demander ce que peut encore apporter l’apprentissage de l’orthographe, de la grammaire, en un mot, de sa langue. Est-ce que savoir écrire en bon français est un avantage compétitif, utile à une future carrière, où est-ce un truc ringard?

A la lecture de très nombreux sites, blogs, et même articles de journaux, on peut se demander si l’art de l’écriture existe encore, et s’il sert à quelque chose.

Ecriture stylo à plume Une bonne part de la difficulté, c’est qu’il y a bien peu de chances que l’on ne vous fasse jamais la remarque, par politesse, par crainte, par manque de confiance. Envoyer à un recruteur un C.V. et lettre de motivations ponctués de fautes est généralement (dépend quand même du poste concerné) une bonne manière de ne jamais être sélectionné, mais le recruteur ne prendra pas la peine de vous répondre en indiquant qu’il ne vous choisi pas à cause de cela….. Il n’y a pas que le recrutement, bien sûr! Combien d’ingénieurs ne montent jamais dans la hiérarchie de l’entreprise, parce que cela signifierais communiquer vers l’extérieur, et l’entreprise tient à son image, dont le bon français fait partie?

J’entends déjà votre réaction à cette lecture (si, si!) “Mais il y a belle lurette qu’on écrit plus de lettres, quant à mon C.V., il a été vérifié et revérifié, pas de problèmes”. Oui, mais….

Read more ›

Posted in Petits trucs facilitant la cyber-vie Tagged with: , ,

Contact Form to Send an Email to the WebMaster

Lately we looked at how to send an email from a MVC website . Now I am going to see how to inject data from a contact form, validate data entry and compose an email using this data.

Create the Model

As in MVC the first letter is for Model, it seems logical to start there. As usual, we need to know the user’s name, email address, and to give him the ability to set a subject, as well as entre the messages’s body.

using System.ComponentModel.DataAnnotations;

namespace BGSoftFactory.FindZilla.WebApp.Models
{
    public class ContactModel
    {        
        [Required]
        [Display(Name = "Your name")]
        public string UserName { get; set; }        

        [RegularExpression(@"^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{email from MVC website1,3})(]?)$",
            ErrorMessage = "Please enter a valid e-mail adress")]
        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        [Required]
        [Display(Name = "Subject")]
        public string Subject { get; set; }

        [Required]   
        [DataType(DataType.MultilineText)]
        [Display(Name = "Text")]
        public string Text{ get; set; }       
    }
}

Note this model/class is NOT linked to any kind of storage. In this particular case I see no reason to store these data in the web application, as they are sent by email which is stored. Annotation attributes are extensively used to ensure proper data entry. Nothing really specific for this model, beside, maybe, the regular expression used to check the email.

Read more ›

Posted in .Net, C#, ASP.NET MVC 4.0, Web

Presentation: WebMatrix 3 Final Version

WebMatrix 3 is available to download from Microsoft in its final version since a few weeks already, but I did not get the time to install and test it until today. I wrote about the beta version a few weeks ago, but as the final version is there now, it’s time to write a post going a bit more in depth. Scott Gu did a quick presentation on his son blog , we are going to follow his lead to install a blog built with Orchard.

WebMatrix 3 First Run

When you start Webmatrix 3 for the first time, you are asked to enter your connection data to your Microsoft account. If you don’t have one, you can create one at this time. If you already have an Azure account, use the same account to start WebMatrix 3. If you don’t have one, you will be able to create one if you want. You don’t HAVE TO do this to use WebMatrix, but as this is one of the new features in this version, I am going to show this to you.

WebMatrixRegistered

Start screen shows that I am connected with my Microsoft account.

Read more ›

Posted in Microsoft, Web

Windows Phone 8: 5 Criteria for a Choice.

I wished to find myself a smartphone since a long while, and, if possible, not “any” smartphone. Being a .Net programmer, it seemed logical to select a Windows Phone 8, as with Visual Studio and his SDK I have all the tools needed to write an app for it. Yet, there was other criterias to fullfill before I made a choice:

  1. -Budget: Being quite limited on that side (who is not?), it was out of the question to put $400 or $500 into a smartphone, however smart it was! That’s the main reason why I never considered an iPhone.
  2. -Camera: It’s very handy to be able to take pictures with your phone, but they have to be of a “good enough” quality to be able to use them and show them.
  3. -GPS: It’s a little bit like for pictures. All latest smartphones have a builtin GPS, but it’s the software which makes the difference: would it really be able to replace my current Garmin Nüvi, or not?
  4. -Screen: Beside the “Cool Factor”, always likable, is the size enough for my fat fingers, enough to read comfortably? Is it sensitive enough to react to gestures, like zooming, without having to do it a few times?
  5. -PC Connection : This should be basic, but my Samsung Jet has always been quite temperamental about this, being recognized by the PC software in a totally random manner.

Read more ›

Posted in ASP.NET MVC 4.0, Hardware, Smartphone

5 Steps to Send Email with MVCMailer from an MVC 4.0 Application

Basically all Internet web sites have a contact form to obfuscate the author email address, in an attempt to diminish spam (Yes, I know…Ho well!). Sending an email from MVC code is quite simple, using the “System.Net.Mail” namespace. Instead, we will see how to send email with MVCMailer, which will allow us to beneficiate from the MVC Views to format the body of our email to our heart’s content.

-1- Install MVCMailer component with NuGet

Read this post first if you don’t know NuGet already. Install MVCMailer, from the online command tool, or in interactive mode:

MVCMailerInstall

Read more ›

Posted in ASP.NET MVC 4.0 Tagged with: , , ,

Improve Loading Speed of a MVC 4.0 Web Application. Part 2

how to improve loading speed of a MVC 4.0 Web Application

I did not completely finish optimizing my site at the end of my previous paper. This is OK, as I had not finished developing the features I wanted for this application. As the site is now being deployed in its first version, now is a good time to see how to improve loading speed of a MVC 4.0 Web Application, to gain a few more tenth of a second, and eliminate a few errors  we may find in the process. We will also use a tool we have not seen so far, Fiddler.

Current state of affairs, as seen by Fiddler

For now, I am not going to worry about loading speed (remember, at the end of the previous paper, it was taking 1.01 second, without cleaning the cache), but to check that we have bundled and put in a cache all that could be. If we find errors on the way, we will see if we can fix them.

FiddlerInitialLoad

Even if most of our files are cached ( as shown by expiration date and time in the “caching” column) , we can notice that a number of CSS and Javascript files are not in bundles (they have been added since the last time). I also know that, even if Fiddler does not show it on this view, my main page and a number of partial views have some Javascript in them, while the best practice is to put that code in a separate file and to bundle it too, so that it will be optimized like the other Javascript and JQuery libraries.

Fiddler show us two errors also (lines 20 & 21)  404 . We have some work to do! Sourire

Read more ›

Posted in .Net, C#, ASP.NET MVC 4.0

Authenticated REST request to the Amazon Product Advertising API using C#

Looking at samples on Amazon Associates, I have been unable to find a current example about sending an authenticated REST request to the Amazon Product Advertising API using C#, either with the API or .Net. So I took what I found, which was for the 2009 version of the API, and Visual Studio 2008, and upgraded it, with minimal changes, to the API version 2011, and Visual Studio 2012. You will still find, in the file to download, the original documentation from Amazon.

It’s a very basic console application which test a few requests, but it’s a good start. Put your own Access Key ID, Secret Key and Associate Tag, compile and run.

I have been checking with the free Visual Studio Express 2012 for the Web edition, and it works perfectly well.

You can also use SOAP, personally I prefer the flexibility given by REST, as you don’t have to be constantly aware of objects types, you deal with XML and that’s all. Familiarity with XML will help, though.

Good luck to you in your new career as Amazon Associate!

If you want to automatically receive new posts published on the site:  Subscribe to BGSoftFactory “Le” Blog

Posted in .Net, C#, Web

NewsLetter

On Site Search

Custom search